;
(function (window, angular) {
    'use strict';
    angular.module("PrintHTMLTemplate", [])
        .constant("TEMPLATE_CODE", {
            Allocation: 1001, // 客户调拨
            SaleOrder: 1002, // 发货通知
            SaleOffset: 1003, // 销售冲销
            GiftOut: 1004,    // 兑换出库单
            CheckReceive: 1115, //收款单
            PrePay: 1116, //结算单
            MakeOutInvoice: 1117, //销售开票审批单
            WaybillMaintenance: 1118, //运单维护
            WaybillReconciliation: 1119, //运费对账
            SocialApply: 1120, //社会渠道申请
            UnusualOut: 2001, // 非正常出库单
            GuaranteesOut: 2002, // 非正常出库单
            UnusualIn: 2003, // 非正常入库单
            ReturnIn: 2004, // 退货入库单打印
            DepotAllocation: 2005, // 区域调拨单
            PickingIn: 2006, // 领料入库
            PickingOut: 2007, // 领料出库
            PickingInGroupByOutLoc: 2006, // 领料入库(按领出仓库分组)
            PickingOutGroupByOutLoc: 2007, // 领料出库(按领出仓库分组)
            Inventory: 2008, // 盘点单
            PurchaseIn: 2009, // 采购入库单
            BeginningIn: 2010, // 期初入库单
            DeliveryOrderIn: 2011, // 配送指令入库单
            BackIn: 2012, // 回购入库单
            ReceiptIn: 2013, // 运单入库单
            BackOut: 2014, // 回购出库单
            ThreeOffset: 2015, // 三包冲销单
            ServiceBorrowOut: 2016, // 服务借用单
            SalesOrderOut: 2017, // 销售出库单
            ServiceBorrowIn: 2018, // 借用退回单
            AgentReturnOrder: 2019, // 退货单
            BorrowIn: 2020, // 借用单
            BorrowBack: 2021, // 归还单
            SalesOrderOutJck: 2022, // 销售出库单（海外模板）
            Handover: 3001, // 发运交接单
            ReturnApply: 3002, // 退货申请
            Encasement: 3003, //发运交接单-装箱清单
            Encasement4JCK: 3004, //发运交接单-装箱清单（进出口专用）
            BoxupNoPack: 3005, //成品发运单
            EncasementD: 3006, //发运交接单-装箱清单明细
            SplitPrint: 5001, //拆件单
            RestorePrint: 5002, //拆件恢复单
            SendPrint: 6001, //送货单
            SellIntention: 6002, //销售订单
            ComplimentaryOut: 6003, // 赠送出库单 
            ContractAgreement: 6004, // 合同协议单 
            Distributormargin: 6005, // 经销商差价核算
            SettlementOfServiceExpenses: 6006, // 劳务费用结算
        })
        .constant("DEFAULT_TEMPLATE_FUN", function(val) {
            var SaleOrderTemplateTpl = { // 发货通知单
                getTheader: function () {
                    return [{
                            keyName: "deliveryNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseUnit",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "saleNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseLevelName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseOrgId",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapOutNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapSaleOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapOutBill",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "materialsNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryOrgId",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "customerPurchaseCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "distributionChannelName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "payConditionName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "orderType",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryTypeName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "settleTypeName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "outLocation",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "outArea",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverPhone",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverFax",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "address",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "applyName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditUserName",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "auditTime",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "auditStatus",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "printDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "totalPrice",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "stockOutDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "agency",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "agencyContactPerson",
                            isChecked: true,
                            isHeader: true
                        }
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "no",
                            isChecked: true
                        },
                        {
                            keyName: "lineNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "defaultLocation",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        },
                        {
                            keyName: "unitPriceAfterAdjust",
                            isChecked: true
                        },
                        {
                            keyName: "totalPrice",
                            isChecked: true
                        },
                        {
                            keyName: "priceGroup",
                            isChecked: true
                        },
                        {
                            keyName: "amountAfterAdjust",
                            isChecked: true
                        },
                        {
                            keyName: "sendQty",
                            isChecked: true
                        },
                        {
                            keyName: "deliveryQty",
                            isChecked: true
                        },
                        {
                            keyName: "otherRemark",
                            isChecked: true
                        },
                        {
                            keyName: "locationCodeStr",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "stealNo",
                            isChecked: false,
                        },                        
                    ];
                },
            };

            var UnusualOutTpl = { // 其它出库单
                getTheader: function () {
                    return [{
                            keyName: "abnormalNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "type",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "innerOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "isSynsap",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "synsapStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "reasonName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "callOutLocation",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "callOutArea",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "status",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "logistics",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "logisticsPerson",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "logisticsPhone",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "agentName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryTypeName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "freightSettleTypeName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "receiverName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "receiverPhone",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "receiverFax",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "address",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "dept",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "applicationDate",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "totalAmount",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseCodeDesc",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditUserName",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "auditTime",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "auditStatus",
                            isChecked: false,
                            isHeader: false
                        },
                    ];
                },
                getTbody: function () {
                    return [{
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "materialsType",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "deliveryAmount",
                            isChecked: true
                        },
                        {
                            keyName: "realQty",
                            isChecked: true
                        },
                        {
                            keyName: "status",
                            isChecked: true
                        },
                        {
                            keyName: "price",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        },
                        /* 去掉默认储位 */
                        // {
                        //     keyName: "stockLocation",
                        //     isChecked: true
                        // },
                        {
                            keyName: "locationCodeStr",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "totalPrice",
                            isChecked: true
                        },
                    ];
                },
            };

            var UnusualInTpl = { // 其它入库单
                getTheader: function () {
                    return [
                        {
                            keyName: "applyNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "type",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "innerOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "innerOrderNote",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "voucherNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "voucherStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "isSynsap",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "synsapStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inLocation",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inArea",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "state",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "dept",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "applicationDate",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "sapOrder",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "warehouseCodeDesc",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditUserName",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "auditTime",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "auditStatus",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "sumTotalPrice",
                            isChecked: true,
                            isHeader: true
                        },
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "materialsType",
                            isChecked: true
                        },
                        {
                            keyName: "materialsMeasure",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "qty",
                            isChecked: true
                        },
                        {
                            keyName: "realQty",
                            isChecked: true
                        },
                        {
                            keyName: "state",
                            isChecked: true
                        },
                        {
                            keyName: "price",
                            isChecked: true
                        },
                        {
                            keyName: "totalPrice",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true
                        }
                    ];
                },
            };

            var HandoverTpl = { // 发运交接单
                getTheader: function () {
                    return [
                        {
                            keyName: "billNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "dealerOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "orgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "shippingMethod",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "settlementDesc",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "deliveryNOs",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "saleBillNos",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "prodTypes",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "machineNumbers",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "crmOrders",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "serviceNos",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "serviceNames",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "serviceSites",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "receiverName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverTel",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverFax",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverAddress",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "deliveryDate",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "carrierAmount",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "carrierOrgName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "carrierUserName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "carrierCar",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "freightNo",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverSite",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "dispatcherName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseLevel",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "billTypeDesc",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "carrierOrgSign",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "issuingOfficerSign",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "warehouseLeaderSign",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "customerSign",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "purchaseContractNo",
                            isChecked: false,
                            isHeader: true
                        },
                        {
                            keyName: "auditUserName",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "auditTime",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "auditStatus",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "printNum",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "prAuditMessage",
                            isChecked: true,
                            isHeader: true
                        },
                    ];
                },
                getTbody: function () {
                    // bodyType:1 装箱前  2 装箱后
                    return [
                        {
                            keyName: "no",
                            isChecked: true,
                            bodyType: 1
                        },
                        {
                            keyName: "materialNo",
                            isChecked: true,
                            bodyType: 1
                        },
                        {
                            keyName: "materialName",
                            isChecked: true,
                            bodyType: 1
                        },
                        {
                            keyName: "unit",
                            isChecked: true,
                            bodyType: 1
                        },
                        {
                            keyName: "locationCode",
                            isChecked: true,
                            bodyType: 1
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true,
                            bodyType: 1
                        },
                        {
                            keyName: "keepName",
                            isChecked: true,
                            bodyType: 1
                        },
                        {
                            keyName: "amount",
                            isChecked: true,
                            bodyType: 1
                        },
                        {
                            keyName: "realAmount",
                            isChecked: true,
                            bodyType: 1
                        },
                        {
                            keyName: "useOnsiteMaterial",
                            isChecked: false,
                            bodyType: 1
                        },
                        {
                            keyName: "stealNo",
                            isChecked: false,
                            bodyType: 1
                        },
                        {
                            keyName: "no",
                            isChecked: true,
                            bodyType: 2
                        },
                        {
                            keyName: "materialsNo",
                            isChecked: true,
                            bodyType: 2
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true,
                            bodyType: 2
                        },
                        {
                            keyName: "boxupNo",
                            isChecked: true,
                            bodyType: 2
                        },
                        {
                            keyName: "deliveryNoteNo",
                            isChecked: true,
                            bodyType: 2
                        },
                        {
                            keyName: "qty",
                            isChecked: true,
                            bodyType: 2
                        }
                    ];
                },
            };

            var GuaranteesOutTpl = { // 三包出库单
                getTheader: function () {
                    return [
                        {
                            keyName: "guaranteesOutNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "customerName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "guaranteesTypeName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createPartName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "callOutLocation",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "callOutArea",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapTypeName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "outStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "receiverPhone",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "prodType",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "machineNumber",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "crmOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "serviceName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "serviceSite",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "serviceNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryTypeName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "settleTypeName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverAddress",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditsCrm",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "leaderNameCrm",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "printTime",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "purAuditName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "deptLeaderName",
                            isChecked: true,
                            isHeader: false
                        }
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDesc",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "qty",
                            isChecked: true
                        },
                        {
                            keyName: "outQty",
                            isChecked: true
                        },
                        {
                            keyName: "deliveryQty",
                            isChecked: true
                        },
                        {
                            keyName: "realOutQty",
                            isChecked: true
                        },
                        {
                            keyName: "status",
                            isChecked: true
                        },
                        {
                            keyName: "locationCodeStr",
                            isChecked: true
                        },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        },
                    ];
                },
            };

            var AllocationTpl = { // 客户调拨单
                getTheader: function () {
                    return [{
                            keyName: "allotOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deptName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "outAgentName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "outAgentContact",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "outAgentPhone",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inAgentName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inAgentContact",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inAgentPhone",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inAddress",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "logisCom",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "logisOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "carrier",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "carrierPhone",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditUserName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditOpinion",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sumTotalPrice",
                            isChecked: true,
                            isHeader: true
                        },
                    ];
                },
                getTbody: function () {
                    return [{
                            keyName: "materialNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialName",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "amount",
                            isChecked: true
                        },
                        {
                            keyName: "refPrice",
                            isChecked: true
                        },
                        {
                            keyName: "totalPrice",
                            isChecked: true
                        },
                    ];
                },
            };

            var ReturnApplyTpl = { // 退货申请单
                getTheader: function () {
                    return [
                        {
                            keyName: "applyNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "saleNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "supplierOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "salesmanName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "isReturnDesc",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        }
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "qty",
                            isChecked: true
                        },
                        {
                            keyName: "returnApplyAmount",
                            isChecked: true
                        },
                        {
                            keyName: "applyQty",
                            isChecked: true
                        }
                    ];
                },
            };

            var PickingInTpl = { // 领料入库单
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "requisitionNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "documentName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "status",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "voucherInNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "voucherInStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapType",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "createPartName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "sapInOrder",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "sapOutOrder",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditUserName",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "auditTime",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "auditStatus",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "auditsCrm",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "leaderNameCrm",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "printTime",
                            isChecked: true,
                            isHeader: false
                        }
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "outLocation",
                            isChecked: true
                        },
                        {
                            keyName: "inLocation",
                            isChecked: true
                        },
                        {
                            keyName: "inLocationArea",
                            isChecked: true
                        },
                        {
                            keyName: "amount",
                            isChecked: true
                        },
                        {
                            keyName: "realAmount",
                            isChecked: true
                        },
                        {
                            keyName: "statusShow",
                            isChecked: true
                        },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true
                        },

                    ];
                },
            };

            var PickingOutTpl = { // 领料出库单
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "requisitionNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "documentName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "status",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "voucherOutNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "voucherOutStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapType",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "createPartName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "sapInOrder",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "sapOutOrder",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditUserName",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "auditTime",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "auditStatus",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "printTime",
                            isChecked: true,
                            isHeader: false
                        }
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "outLocation",
                            isChecked: true
                        },
                        {
                            keyName: "outLocationArea",
                            isChecked: true
                        },
                        {
                            keyName: "inLocation",
                            isChecked: true
                        },
                        {
                            keyName: "amount",
                            isChecked: true
                        },
                        {
                            keyName: "realOutQty",
                            isChecked: true
                        },
                        {
                            keyName: "outStatus",
                            isChecked: true
                        },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        }
                    ];
                },
            };

            var PickingInGroupByOutLocTpl = { // 领料入库(按领出仓库分组)
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "requisitionNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "documentName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "statusIn",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "voucherInNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "voucherInStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapType",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "createPartName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "sapInOrder",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "sapOutOrder",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditUserName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditTime",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditStatus",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditsCrmC",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "leaderNameCrmC",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "printTime",
                            isChecked: true,
                            isHeader: false
                        }
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "outLocation",
                            isChecked: true
                        },
                        {
                            keyName: "inLocation",
                            isChecked: true
                        },
                        {
                            keyName: "inLocationArea",
                            isChecked: true
                        },
                        {
                            keyName: "amount",
                            isChecked: true
                        },
                        {
                            keyName: "realAmount",
                            isChecked: true
                        },
                        {
                            keyName: "statusShow",
                            isChecked: true
                        },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        }
                    ];
                }
            };

            var PickingOutGroupByOutLocTpl = { // 领料出库(按领出仓库分组)
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "requisitionNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "documentName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "statusIn",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "voucherOutNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "voucherOutStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapType",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "createPartName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "sapInOrder",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "sapOutOrder",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditUserName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditTime",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditStatus",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "printTime",
                            isChecked: true,
                            isHeader: false
                        }
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "outLocation",
                            isChecked: true
                        },
                        {
                            keyName: "outLocationArea",
                            isChecked: true
                        },
                        {
                            keyName: "inLocation",
                            isChecked: true
                        },
                        {
                            keyName: "amount",
                            isChecked: true
                        },
                        {
                            keyName: "realOutQty",
                            isChecked: true
                        },
                        {
                            keyName: "outStatus",
                            isChecked: true
                        },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        }
                    ];
                }
            };

            var InventoryTpl = { // 盘点单
                getTheader: function () {
                    return [{
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inventoryNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseCodeI",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "locationCodesStr",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "checkType",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "checkStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "custodian",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inventoryCreateName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inventoryCreateDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "startName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inventoryDes",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "plannedDate",
                            isChecked: true,
                            isHeader: true
                        }
                    ];
                },
                getTbody: function () {
                    return [{
                            keyName: "barCode",
                            isChecked: true
                        },
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "loactionCode",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "sysAmount",
                            isChecked: true
                        },
                        {
                            keyName: "actAmount",
                            isChecked: true
                        },
                        {
                            keyName: "depositaryName",
                            isChecked: true
                        },
                        {
                            keyName: "stateShow",
                            isChecked: true
                        },
                        {
                            keyName: "inventoryUserName",
                            isChecked: true
                        }
                    ];
                },
            };

            var PurchaseInTpl = { // 采购入库单
                getTheader: function () {
                    return [{
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseInboundOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseRequestOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseGroup",
                            isChecked: false,
                            isHeader: true
                        },
                        {
                            keyName: "supplierName",
                            isChecked: false,
                            isHeader: true
                        },
                        {
                            keyName: "supplierCode",
                            isChecked: false,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseVoucher",
                            isChecked: false,
                            isHeader: true
                        },
                        {
                            keyName: "materialsNo",
                            isChecked: false,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "callInArea",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "state",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deptName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseCreateDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "postTimeStr",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inspector",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "receiverName",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "warehouseCodeDesc",
                            isChecked: true,
                            isHeader: true
                        }
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialName",
                            isChecked: true
                        },
                        {
                            keyName: "materialsMeasure",
                            isChecked: true
                        },
                        {
                            keyName: "rowNo",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "price",
                            isChecked: true
                        },
                        {
                            keyName: "purchaseInQty",
                            isChecked: true
                        },
                        {
                            keyName: "sendQty",
                            isChecked: true
                        },
                        {
                            keyName: "purchaseInQtyIn",
                            isChecked: true
                        },
                        {
                            keyName: "realAmount",
                            isChecked: true
                        },
                        {
                            keyName: "statusShow",
                            isChecked: true
                        },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        },
                        {
                            keyName: "qualifiedQuantity",
                            isChecked: false
                        },
                        {
                            keyName: "realQuantity",
                            isChecked: false
                        },
                    ];
                },
            };

            var BeginningInTpl = { // 期初入库单
                getTheader: function () {
                    return [{
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "beginningInAbnormalNoIn",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "beginningInInLocation",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "state",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deptName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "beginningInCreateDate",
                            isChecked: true,
                            isHeader: true
                        }
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialName",
                            isChecked: true
                        },
                        {
                            keyName: "materialsMeasure",
                            isChecked: true
                        },
                        {
                            keyName: "totalQty",
                            isChecked: true
                        },
                        {
                            keyName: "minPackQty",
                            isChecked: true
                        },
                        {
                            keyName: "realQty",
                            isChecked: true
                        },
                        {
                            keyName: "orawyd",
                            isChecked: true
                        },
                        {
                            keyName: "vinId",
                            isChecked: true
                        },
                        {
                            keyName: "statusShow",
                            isChecked: true
                        },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        },
                    ];
                },
            };

            var ReturnInTpl = { // 退货入库单
                getTheader: function () {
                    return [{
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "returnInNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "returnInBillTypeName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "returnApplyNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deptName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createBillDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "callInArea",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "state",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: false
                        }

                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialName",
                            isChecked: true
                        },
                        {
                            keyName: "materialsMeasure",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "returnOutTotal",
                            isChecked: true
                        },
                        {
                            keyName: "appliedQtyIn",
                            isChecked: true
                        },
                        {
                            keyName: "qty",
                            isChecked: true
                        },
                        {
                            keyName: "realQty",
                            isChecked: true
                        },
                        {
                            keyName: "statusShow",
                            isChecked: true
                        },
                        {
                            keyName: "loactionCode",
                            isChecked: true
                        },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        },
                    ];
                },
            };

            var BackInTpl = { // 回购入库单
                getTheader: function () {
                    return [{
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inboundOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "backOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inArea",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "state",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: false
                        }

                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialName",
                            isChecked: true
                        },
                        {
                            keyName: "materialType",
                            isChecked: true
                        },
                        {
                            keyName: "materialsMeasure",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "backInQty",
                            isChecked: true
                        },
                        {
                            keyName: "sendQty",
                            isChecked: true
                        },
                        {
                            keyName: "thisTimeAmount",
                            isChecked: true
                        },
                        {
                            keyName: "realAmount",
                            isChecked: true
                        },
                        {
                            keyName: "statusShow",
                            isChecked: true
                        },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        },
                    ];
                },
            };

            var DepotAllocationTpl = { // 区域调拨单
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "allotOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "allotPlanOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "callOutLocation",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "callOutArea",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "callInLocation",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "callInArea",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "outWarehouseCodeDesc",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inWarehouseCodeDesc",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapTypeName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapInOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deptName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createBillDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapOutOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "receiverName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "receiverPhone",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "address",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "allotTypeDesc",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditsCrm",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "leaderNameCrm",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "printTime",
                            isChecked: true,
                            isHeader: false
                        },
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialName",
                            isChecked: true
                        },
                        {
                            keyName: "materialsMeasure",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "amount",
                            isChecked: true
                        },
                        {
                            keyName: "callOutCompleteQty",
                            isChecked: true
                        },
                        {
                            keyName: "callInCompleteQty",
                            isChecked: true
                        },
                        {
                            keyName: "locationCodeStr",
                            isChecked: true
                        },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true
                        },
                    ];
                },
            };

            var DeliveryOrderInTpl = { // 配送指令入库单
                getTheader: function () {
                    return [{
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryInstructionNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "locationCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createBillDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "state",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "postingStateShow",
                            isChecked: true,
                            isHeader: true
                        }
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialName",
                            isChecked: true
                        },
                        {
                            keyName: "rowNo",
                            isChecked: true
                        },
                        {
                            keyName: "qty",
                            isChecked: true
                        },
                        {
                            keyName: "realQty",
                            isChecked: true
                        },
                        {
                            keyName: "statusShow",
                            isChecked: true
                        },
                        {
                            keyName: "postingStateShow",
                            isChecked: true
                        },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        },
                    ];
                },
            };

            var SaleOffsetTpl = { // 销售冲销单
                getTheader: function () {
                    return [{
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "reverseOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "customerName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseNumber",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "isPostingAccount",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditUserName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditOpinion",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: true
                        }
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialName",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "applyDeliverQty",
                            isChecked: true
                        },
                        {
                            keyName: "realDeliverQty",
                            isChecked: true
                        },
                        {
                            keyName: "planQtyIn",
                            isChecked: true
                        },
                        {
                            keyName: "realQty",
                            isChecked: true
                        },
                        {
                            keyName: "statusShow",
                            isChecked: true
                        },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        },
                    ];
                },
            };

            var SplitInTpl = { // 拆件单
                getTheader: function () {
                    return [{
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "splitOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "splitType",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "splitStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "restoreStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "firstAuditName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "firstAuditDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "firstAuditNote",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "secondAuditName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "secondAuditDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "secondAuditNote",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "thirdAuditName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "thirdAuditDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "thirdAuditNote",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "fourthAuditName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "fourthAuditDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "fourthAuditNote",
                            isChecked: true,
                            isHeader: true
                        },
                    ];
                },
                getTbody: function () {
                    return [{
                            keyName: "matTypeDesc",
                            isChecked: true
                        },
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "materialsType",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "amount",
                            isChecked: true
                        },
                        {
                            keyName: "splitAmount",
                            isChecked: true
                        },
                        {
                            keyName: "restoreAmount",
                            isChecked: true
                        },
                        {
                            keyName: "inAmount",
                            isChecked: true
                        },
                        {
                            keyName: "outAmount",
                            isChecked: true
                        }
                    ];
                },
            };

            var RestoreInTpl = { // 拆件恢复单
                getTheader: function () {
                    return [{
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "restoreOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "splitOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "amount",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "restoreAmount",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: true
                        }
                    ];
                },
                getTbody: function () {
                    return [{
                            keyName: "barcode",
                            isChecked: true
                        },
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "materialsType",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "amount",
                            isChecked: true
                        },
                        {
                            keyName: "restoreStatusStr",
                            isChecked: true
                        },
                        {
                            keyName: "restoreName",
                            isChecked: true
                        },
                        {
                            keyName: "restoreDateStr",
                            isChecked: true
                        }
                    ];
                },
            };

            var SendInTpl = { // 送货单
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sendOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "isSign",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "isDelivery",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "soldOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "applyOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "logisticsCompany",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "logisticsOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "contactUser",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "contactTel",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "address",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseCodeDesc",
                            isChecked: true,
                            isHeader: true
                        }
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "sourceOrder",
                            isChecked: true
                        },
                        {
                            keyName: "rowNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "price",
                            isChecked: true
                        },
                        {
                            keyName: "qty",
                            isChecked: true
                        },
                        {
                            keyName: "realQty",
                            isChecked: true
                        },
                        {
                            keyName: "postingNum",
                            isChecked: true
                        },
                        {
                            keyName: "voucherNo",
                            isChecked: true
                        },
                        {
                            keyName: "sapErrorMsg",
                            isChecked: true
                        },
                        {
                            keyName: "note",
                            isChecked: true
                        },
                    ];
                },
            };

            var ReceiptInTpl = { // 运单入库单
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "billNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "receiptNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "areaCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "supplierOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "status",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseCodeDesc",
                            isChecked: true,
                            isHeader: true
                        }
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "materialsType",
                            isChecked: true
                        },
                        {
                            keyName: "materialsMeasure",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "price",
                            isChecked: true
                        },
                        {
                            keyName: "amount",
                            isChecked: true
                        },
                        {
                            keyName: "realAmount",
                            isChecked: true
                        },
                        {
                            keyName: "status",
                            isChecked: true
                        },
                        {
                            keyName: "note",
                            isChecked: true
                        },
                        {
                            keyName: "locationCode",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                    ];
                },
            };

            var BackOutTpl = { // 回购出库单
                getTheader: function () {
                    return [{
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "outboundOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "backOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "callOutLocation",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "callOutArea",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "outStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: false
                        }

                    ];
                },
                getTbody: function () {
                    return [{
                            keyName: "materialNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialName",
                            isChecked: true
                        },
                        {
                            keyName: "materialType",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "backInQty",
                            isChecked: true
                        },
                        {
                            keyName: "sendQty",
                            isChecked: true
                        },
                        {
                            keyName: "thisTimeOutAmount",
                            isChecked: true
                        },
                        {
                            keyName: "realAmount",
                            isChecked: true
                        },
                        {
                            keyName: "outStatus",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                    ];
                },
            };

            var ThreeOffsetTpl = { // 三包冲销单
                getTheader: function () {
                    return [{
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "reverseOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "businessOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "agentName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inArea",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditState",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditUserName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditDate",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditNote",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "isPosting",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "isSapReverse",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "voucherNo",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "sapErrorMsg",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: false
                        },
                    ];
                },
                getTbody: function () {
                    return [{
                            keyName: "materialNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialName",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "deliveryQty",
                            isChecked: true
                        },
                        {
                            keyName: "realQty",
                            isChecked: true
                        },
                        {
                            keyName: "amount",
                            isChecked: true
                        },
                        {
                            keyName: "realAmount",
                            isChecked: true
                        },
                        {
                            keyName: "stateShow",
                            isChecked: true
                        },
                    ];
                },
            };

            var ServiceBorrowOutTpl = { // 服务借用单
                getTheader: function () {
                    return [{
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "borrowNo", // 服务借用单号
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "serviceStaffName", // 服务人员
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "outLocation", // 发出仓库
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "customerName", // 客户名称
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "reason", // 原因
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "dispatchNo", // 派工单号
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remark", // 备注
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "status", // 出库状态
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "totalPrice", // 总价
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseCodeDesc", // 仓库描述
                            isChecked: true,
                            isHeader: true
                        },
                    ]
                },
                getTbody: function () {
                    return [{
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "borrowCount",
                            isChecked: true
                        },
                        {
                            keyName: "price",
                            isChecked: true
                        },
                        {
                            keyName: "realQty",
                            isChecked: true
                        },
                        {
                            keyName: "agentRetailPrice",
                            isChecked: true
                        },
                        {
                            keyName: "customerSign",
                            isChecked: true
                        },
                        {
                            keyName: "usedCount",
                            isChecked: true
                        },
                        {
                            keyName: "usedCars",
                            isChecked: true
                        },
                        {
                            keyName: "usedType",
                            isChecked: true
                        },
                        {
                            keyName: "priceNote",
                            isChecked: true
                        },
                        {
                            keyName: "soldQuantity",
                            isChecked: true
                        },
                        {
                            keyName: "returnedQuantity",
                            isChecked: true
                        },
                        {
                            keyName: "stateShow",
                            isChecked: true
                        },
                        {
                            keyName: "locationCodeStr",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "subTotal",
                            isChecked: true
                        },
                    ]
                },
            };

            var SalesOrderOutTpl = { // 销售出库单
                getTheader: function () {
                    return [{
                            keyName: "salesOutBillNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "salesBillNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "borrowBillNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "clientName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "generatePerson",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "generateDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "servicePersonName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "outboundStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "outboundDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "salesOrderOutArea",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "totalPrice",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "checkState",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "returnInBillTypeName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "useMachineNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "settleMachineNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseCodeDesc",
                            isChecked: true,
                            isHeader: true
                        }
                    ]
                },
                getTbody: function () {
                    return [{
                            keyName: "materialNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialDes",
                            isChecked: true
                        },
                        // {
                        //     keyName: "defaultStorage",
                        //     isChecked: true
                        // },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationCodeStr",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "totalOrderQty",
                            isChecked: true
                        },
                        {
                            keyName: "issuedQty",
                            isChecked: true
                        },
                        {
                            keyName: "thisShipQty",
                            isChecked: true
                        },
                        {
                            keyName: "singlePrice",
                            isChecked: true
                        },
                        {
                            keyName: "realStockQty",
                            isChecked: true
                        },
                        {
                            keyName: "intentOccupation",
                            isChecked: true
                        },
                        {
                            keyName: "shipOccupation",
                            isChecked: true
                        },
                        {
                            keyName: "safetyStock",
                            isChecked: true
                        },
                        {
                            keyName: "onlineStock",
                            isChecked: true
                        },
                    ]
                },
            };

            var SalesOrderOutJckTpl = { // 销售出库单(海外模板)
                getTheader: function () {
                    return [{
                            keyName: "invoiceNoJck",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "salesOutBillNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "orgCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "clientNameJck",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "contactPhone",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "servicePersonNameJck",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remarkJck",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "vat",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "totalPriceJck",
                            isChecked: true,
                            isHeader: false
                        },
                    ]
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "no",
                            isChecked: true
                        },
                        {
                            keyName: "materialNoJck",
                            isChecked: true
                        },
                        {
                            keyName: "materialDes",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDesENT",
                            isChecked: true
                        },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationCodeStr",
                            isChecked: true
                        },
                        {
                            keyName: "singlePrice",
                            isChecked: true
                        },
                        {
                            keyName: "thisShipQtyJck",
                            isChecked: true
                        },
                        {
                            keyName: "amountJck",
                            isChecked: true
                        },
                        {
                            keyName: "machineModelJck",
                            isChecked: true
                        },
                        {
                            keyName: "carNoJck",
                            isChecked: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true
                        },
                    ]
                },
            };

            var ServiceBorrowInTpl = { // 借用退回单
                getTheader: function () {
                    return [{
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "borrowInNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "borrowBillNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "serviceStaffName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "backInLocation",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "inStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseCodeDesc",
                            isChecked: true,
                            isHeader: true
                        }
                    ]
                },
                getTbody: function () {
                    return [{
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "thisReturnQty",
                            isChecked: true
                        },
                        {
                            keyName: "returnQty",
                            isChecked: true
                        },
                        {
                            keyName: "borrowOutboundQty",
                            isChecked: true
                        },
                        {
                            keyName: "soldQuantity",
                            isChecked: true
                        },
                        {
                            keyName: "price",
                            isChecked: true
                        },
                        {
                            keyName: "borrowReturnQty",
                            isChecked: true
                        }
                    ]
                },
            };

            var AgentReturnOrderTpl = { // 退货单
                getTheader: function () {
                    return [{
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "returnBillNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "salesOutBillNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "receiptBillNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditUserName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditOpinion",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "generatePerson",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "generateDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "state",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "checkState",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "orderType",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "totalAmount",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseCodeDesc",
                            isChecked: true,
                            isHeader: true
                        }
                    ]
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialDes",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "singlePrice",
                            isChecked: true
                        },
                        {
                            keyName: "applyQty",
                            isChecked: true
                        },
                        {
                            keyName: "remainReturnQty",
                            isChecked: true
                        },
                    ]
                },
            };

            var EncasementTpl = { // 装箱清单
                getTheader: function () {
                    return [
                        {
                            keyName: "billNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sourceBillNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "dealerOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "salesType",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "country",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "orgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "shippingMethod",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "settlementDesc",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "deliveryNOs",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "receiverName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverTel",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverFax",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverAddress",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "deliveryDate",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "carrierAmount",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "carrierOrgName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "carrierUserName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "carrierCar",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "freightNo",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverSite",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "dispatcherName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseLevel",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "billTypeDesc",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseContractNoJck",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "carrierOrgSign",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "issuingOfficerSign",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "warehouseLeaderSign",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "customerSign",
                            isChecked: true,
                            isHeader: false
                        }
                    ];
                },
                getTbody: function () {
                    return [{
                            keyName: "boxCode",
                            isChecked: true
                        },
                        {
                            keyName: "boxupNoJck",
                            isChecked: true
                        },
                        {
                            keyName: "packDesc",
                            isChecked: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true
                        },
                        {
                            keyName: "createTime",
                            isChecked: true
                        },
                        {
                            keyName: "measurement",
                            isChecked: true
                        },
                        {
                            keyName: "WT",
                            isChecked: true
                        },
                        {
                            keyName: "tempLocationCode",
                            isChecked: true
                        }
                    ];
                },
            };

            var Encasement4JCKTpl = { // 装箱清单(进出口)
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "billNoT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "packCodeT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "mjweightT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "countryT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "lwhT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "boxCodeT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "boxupNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createNameT",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "checkerNameT",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "createTimeShowT",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "dealerOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "no",
                            isChecked: true
                        },
                        {
                            keyName: "batchNo",
                            isChecked: true
                        },
                        {
                            keyName: "machineModelT",
                            isChecked: true
                        },
                        {
                            keyName: "materialsNoT",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDesCNT",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDesENT",
                            isChecked: true
                        },
                        {
                            keyName: "qtyT",
                            isChecked: true
                        },
                        {
                            keyName: "originalMaterialsNoT",
                            isChecked: true
                        },
                        {
                            keyName: "shippingNoteT",
                            isChecked: true
                        }
                    ];
                },
            };

            var EncasementDTpl = { // 装箱清单明细
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "billNoT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "packCodeT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "mjweightT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "countryT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "lwhT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "boxCodeT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "boxupNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createNameT",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "checkerNameT",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "createTimeShowT",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "remarkT",
                            isChecked: false,
                            isHeader: true
                        },
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "no",
                            isChecked: true
                        },
                        {
                            keyName: "batchNo",
                            isChecked: true
                        },
                        {
                            keyName: "machineModelT",
                            isChecked: true
                        },
                        {
                            keyName: "materialsNoT",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDesCNT",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDesENT",
                            isChecked: true
                        },
                        {
                            keyName: "qtyT",
                            isChecked: true
                        },
                        {
                            keyName: "originalMaterialsNoT",
                            isChecked: true
                        }
                    ];
                },
            };

            var BoxupNoPackTpl = { // 成品发运单
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "billNoT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "countryT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryStatusT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "statusT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createNameT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createTimeT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "updateNameT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "updateTimeT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "acceptNameT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "checkTimeT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryNameT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryTimeT",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "requireDeliveryTime",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryAddress",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "shippingMethodConcat",
                            isChecked: true,
                            isHeader: true
                        },
                    ];
                },
                getTbody: function () {
                    return [{
                        keyName: "no",
                        isChecked: true
                    },
                    {
                        keyName: "boxCode",
                        isChecked: true
                    },
                    {
                        keyName: "boxupNo",
                        isChecked: true
                    },
                    {
                        keyName: "packDesc",
                        isChecked: true
                    },
                    {
                        keyName: "purchaseContractNo",
                        isChecked: true
                    },
                    {
                        keyName: "createName",
                        isChecked: true
                    },
                    {
                        keyName: "createTime",
                        isChecked: true
                    },
                    {
                        keyName: "rwT",
                        isChecked: true
                    },
                    {
                        keyName: "lwhT",
                        isChecked: true
                    },
                    {
                        keyName: "deliveryStatus",
                        isChecked: true
                    },
                    {
                        keyName: "tempLocationCode",
                        isChecked: true
                    },
                    {
                        keyName: "marks",
                        isChecked: true
                    },
                    {
                        keyName: "companyAddressName",
                        isChecked: true
                    },
                ];
                },
            };

            var CheckReceiveTpl = { // 收款单
                getTheader: function () {
                    return [{
                            keyName: "dealerCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapOutNoList",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "checkReceiveTotalPrice",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "payDesc",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "paymentBank",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "paymentAccount",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "paymentDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "operatorName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "reMoneyType",
                            isChecked: true,
                            isHeader: true
                        },
                    ];
                },
                getTbody: function () {
                    return [{
                            keyName: "billNo",
                            isChecked: true
                        },
                        {
                            keyName: "billSingleShow",
                            isChecked: true
                        },
                        {
                            keyName: "billDateShow",
                            isChecked: true
                        },
                        {
                            keyName: "totalPrice",
                            isChecked: true
                        },
                        {
                            keyName: "receivePrice",
                            isChecked: true
                        },
                        {
                            keyName: "checkPrice",
                            isChecked: true
                        },
                    ];
                },
            };

            var PrePayTpl = { // 结算单
                getTheader: function () {
                    return [{
                            keyName: "dealerCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "customerName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "prePayTotalPrice",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "payDesc",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "settleTypeName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "paymentDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "paymentBank",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "paymentAccount",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true,
                            isHeader: true
                        },
                    ];
                },
                getTbody: function () {
                    return [{
                            keyName: "dealerCode",
                            isChecked: true
                        },
                        {
                            keyName: "customerName",
                            isChecked: true
                        },
                        {
                            keyName: "prePayTotalPrice",
                            isChecked: true
                        },
                        {
                            keyName: "sumPrice",
                            isChecked: true
                        }
                    ];
                },
            };

            var MakeOutInvoiceTpl = { // 销售开票审批单
                getTheader: function () {
                    return [{
                            keyName: "invoiceNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createTime",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "customerName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "customerCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "receiverPhone",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "delOffice",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "payDesc",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "invoiceReq",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "serviceHandler",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createUserName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditUserName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "financeAuditUserName",
                            isChecked: true,
                            isHeader: false
                        },
                    ];
                },
                getTbody: function () {
                    return [{
                            keyName: "rowNo",
                            isChecked: true
                        },
                        /* 业务单据号 */
                        {
                            keyName: "deliveryNoteNo",
                            isChecked: true
                        },
                        /* 零件编号 */
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        /* 零件中文名 */
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        /* 单价 */
                        {
                            keyName: "price",
                            isChecked: true
                        },
                        /* 数量 */
                        {
                            keyName: "qty",
                            isChecked: true
                        },
                        /* 总价 */
                        {
                            keyName: "amount",
                            isChecked: true
                        },
                        /* 备注 */
                        {
                            keyName: "remark",
                            isChecked: true
                        },
                        /* 零件凭证号 */
                        {
                            keyName: "materialsPZNo",
                            isChecked: true
                        },
                        /* SAP外向交货单 */
                        {
                            keyName: "sapOutBill",
                            isChecked: true
                        },
                        /* SAP采购订单 */
                        {
                            keyName: "sapSaleOrder",
                            isChecked: true
                        },
                        /* 零件单位 */
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                    ];
                },
            };

            var BorrowInTpl = { // 借用单
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "status",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "code",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "serviceInformationMember",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "crantNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseLeadIn",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseAreaLeadIn",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "borrowReasonDesc",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "expectedArrivalDateShow",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "factoryNumber",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "borrower",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createdDateShow",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "batchNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remarks",
                            isChecked: true,
                            isHeader: true
                        },
                    ]
                },
                getTbody: function () {
                    return [{
                            keyName: "materialNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialDesc",
                            isChecked: true
                        },
                        {
                            keyName: "amount",
                            isChecked: true
                        },
                        {
                            keyName: "remarks",
                            isChecked: true
                        },
                    ]
                },
            };

            var BorrowBackTpl = { // 归还单
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "code",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "borrowCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remarks",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "status",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "serviceInformationMember",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "crantNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseOut",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "warehouseAreaOut",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "borrowReasonDesc",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "factoryNumber",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "returnBy",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "batchNo",
                            isChecked: true,
                            isHeader: true
                        },

                    ]
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialDesc",
                            isChecked: true
                        },
                        {
                            keyName: "amount",
                            isChecked: true
                        },
                        {
                            keyName: "remarks",
                            isChecked: true
                        },
                    ]
                },
            };

            var WaybillMaintenanceTpl = { // 运单
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "dealerOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "wayBillNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "shippingMethod",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryTime",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "carrierOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createUserName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "status",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditUserName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditRemark",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverTel",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverAddress",
                            isChecked: true,
                            isHeader: false
                        },
                    ]
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "no",
                            isChecked: true
                        },
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "amount",
                            isChecked: true
                        },
                        {
                            keyName: "businessOrder",
                            isChecked: true
                        },
                    ]
                },
            };

            var WaybillReconciliationTpl = { // 运费
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "wayBillFeeNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "totalFee",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "afterAuditTotalFee",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "shippingMethod",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "status",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditUserName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditTime",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "approvalUserName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "approvalDate",
                            isChecked: true,
                            isHeader: false
                        },
                    ]
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "no",
                            isChecked: true
                        },
                        {
                            keyName: "wayBillNo",
                            isChecked: true
                        },
                        {
                            keyName: "dealerOrgName",
                            isChecked: true
                        },
                        {
                            keyName: "businessOrderNosXGFJ",
                            isChecked: true
                        },
                        {
                            keyName: "businessOrderNosXGSC",
                            isChecked: true
                        },
                        {
                            keyName: "initinalCarriage",
                            isChecked: true
                        },
                        {
                            keyName: "afterModifyCarriage",
                            isChecked: true
                        },
                        {
                            keyName: "finalCarriage",
                            isChecked: true
                        },
                        {
                            keyName: "carrierOrgName",
                            isChecked: true
                        },
                    ]
                },
            };

            var GiftOutTpl = { // 兑换出库单
                getTheader: function () {
                    return [{
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "exchangeOutNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "exchangeName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "outboundDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "totalPrice",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "exchangeNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "outLocation",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "outArea",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true,
                            isHeader: false
                        },
                    ];
                },
                getTbody: function () {
                    return [{
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "price",
                            isChecked: true
                        },
                        {
                            keyName: "applyQty",
                            isChecked: true
                        },
                        {
                            keyName: "deliveryQty",
                            isChecked: true
                        },
                        {
                            keyName: "issuedQty",
                            isChecked: true
                        },
                        {
                            keyName: "realStockQty",
                            isChecked: true
                        },
                        {
                            keyName: "intentOccupation",
                            isChecked: true
                        },
                        {
                            keyName: "locationCodeStr",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "shipOccupation",
                            isChecked: true
                        },
                    ];
                },
            };

            var SocialApplyTpl = { // 社会渠道申请单
                getTheader: function () {
                    return [
                        {
                            keyName: "applyNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "applyOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "applyName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "applyDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "dispatchName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "dispatchDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "auditDate",
                            isChecked: true,
                            isHeader: true
                        },
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "no",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "machineModel",
                            isChecked: true
                        },
                        {
                            keyName: "qty",
                            isChecked: true
                        },
                        {
                            keyName: "reason",
                            isChecked: true
                        },
                        {
                            keyName: "factoryName",
                            isChecked: true
                        },
                        {
                            keyName: "factoryContact",
                            isChecked: true
                        },
                        {
                            keyName: "price",
                            isChecked: true
                        },
                        {
                            keyName: "period",
                            isChecked: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true,
                            isHeader: true
                        },
                    ];
                },
            };

            var SellIntentionTpl = { // 销售订单
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "saleNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseLevelName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "printDate",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliverTypeName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "settleTypeName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverPhone",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiveAddress",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "remark",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: false
                        },
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "qty",
                            isChecked: true
                        },
                        {
                            keyName: "enableNum",
                            isChecked: true
                        },
                        {
                            keyName: "deliveryNum",
                            isChecked: true
                        },
                    ];
                },
            };

            var ComplimentaryOutTpl = { // 赠送出库单
                getTheader: function () {
                    return [
                        {
                            keyName: "guaranteesOutNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "customerName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "guaranteesTypeName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createPartName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "callOutLocation",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "callOutArea",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapTypeName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "outStatus",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "note",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "receiverPhone",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "sapOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "crmOrder",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryTypeName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "settleTypeName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "receiverAddress",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "auditsCrm",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "leaderNameCrm",
                            isChecked: false,
                            isHeader: false
                        },
                        {
                            keyName: "printTime",
                            isChecked: true,
                            isHeader: false
                        },
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDesc",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "qty",
                            isChecked: true
                        },
                        {
                            keyName: "outQty",
                            isChecked: true
                        },
                        {
                            keyName: "deliveryQty",
                            isChecked: true
                        },
                        {
                            keyName: "realOutQty",
                            isChecked: true
                        },
                        {
                            keyName: "status",
                            isChecked: true
                        },
                        {
                            keyName: "locationCodeStr",
                            isChecked: true
                        },
                        {
                            keyName: "stockLocation",
                            isChecked: true
                        },
                        {
                            keyName: "locationDesc",
                            isChecked: true
                        },
                        {
                            keyName: "stockUserName",
                            isChecked: true
                        }
                    ];
                },
            };

            var ContractAgreementTpl = { // 合同协议单
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "billNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "purchaseOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "supplierOrgName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "dispatcherName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "createDate",
                            isChecked: true,
                            isHeader: false
                        },
                        {
                            keyName: "payType",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "payCondition",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "deliveryPayMethod",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true,
                            isHeader: true
                        },
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "materialsNo",
                            isChecked: true
                        },
                        {
                            keyName: "materialsDes",
                            isChecked: true
                        },
                        {
                            keyName: "materialsType",
                            isChecked: true
                        },
                        {
                            keyName: "unit",
                            isChecked: true
                        },
                        {
                            keyName: "qty",
                            isChecked: true
                        },
                    ];
                },
            };

            var DistributormarginTpl = { // 经销商差价核算
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "billNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "dealerName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "dealerCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "allTotalAdjust",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "allTotalSale",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "allTotalMargin",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "createName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true,
                            isHeader: true
                        },
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "deliveryNo",
                            isChecked: true
                        },
                        {
                            keyName: "saleNo",
                            isChecked: true
                        },
                        {
                            keyName: "deliveryCreateDateShow",
                            isChecked: true
                        },
                        {
                            keyName: "totalAdjust",
                            isChecked: true
                        },
                        {
                            keyName: "totalSale",
                            isChecked: true
                        },
                        {
                            keyName: "totalMargin",
                            isChecked: true
                        },
                    ];
                },
            };
            var SettlementOfServiceExpensesTpl = { // 劳务费用结算
                getTheader: function () {
                    return [
                        {
                            keyName: "qrcode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "billNo",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "dealerName",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "dealerCode",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "allTotalRealPrice",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "allTotalAdjust",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "allTotalMargin",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "agent",
                            isChecked: true,
                            isHeader: true
                        },
                        {
                            keyName: "remark",
                            isChecked: true,
                            isHeader: true
                        },
                    ];
                },
                getTbody: function () {
                    return [
                        {
                            keyName: "distributionNo",
                            isChecked: true
                        },
                        {
                            keyName: "saleNo",
                            isChecked: true
                        },
                        {
                            keyName: "totalRealPrice",
                            isChecked: true
                        },
                        {
                            keyName: "totalAdjust",
                            isChecked: true
                        },
                        {
                            keyName: "totalMargin",
                            isChecked: true
                        },
                        {
                            keyName: "deliveryNo",
                            isChecked: true
                        }
                    ];
                },
            };
            
            var resObj = {
                SaleOrder: SaleOrderTemplateTpl,
                UnusualOut: UnusualOutTpl,
                UnusualIn: UnusualInTpl,
                Handover: HandoverTpl,
                GuaranteesOut: GuaranteesOutTpl,
                Allocation: AllocationTpl,
                ReturnApply: ReturnApplyTpl,
                PickingIn: PickingInTpl,
                PickingOut: PickingOutTpl,
                PickingInGroupByOutLoc: PickingInGroupByOutLocTpl,
                PickingOutGroupByOutLoc: PickingOutGroupByOutLocTpl,
                Inventory: InventoryTpl,
                PurchaseIn: PurchaseInTpl,
                BeginningIn: BeginningInTpl,
                ReturnIn: ReturnInTpl,
                BackIn: BackInTpl,
                DepotAllocation: DepotAllocationTpl,
                DeliveryOrderIn: DeliveryOrderInTpl,
                SaleOffset: SaleOffsetTpl,
                SplitPrint: SplitInTpl,
                RestorePrint: RestoreInTpl,
                SendPrint: SendInTpl,
                ReceiptIn: ReceiptInTpl,
                BackOut: BackOutTpl,
                ThreeOffset: ThreeOffsetTpl,
                ServiceBorrowOut: ServiceBorrowOutTpl,
                SalesOrderOut: SalesOrderOutTpl,
                SalesOrderOutJck: SalesOrderOutJckTpl,
                ServiceBorrowIn: ServiceBorrowInTpl,
                AgentReturnOrder: AgentReturnOrderTpl,
                Encasement: EncasementTpl,
                Encasement4JCK: Encasement4JCKTpl,
                EncasementD: EncasementDTpl,
                BoxupNoPack: BoxupNoPackTpl,
                CheckReceive: CheckReceiveTpl,
                PrePay: PrePayTpl,
                MakeOutInvoice: MakeOutInvoiceTpl,
                BorrowIn: BorrowInTpl,
                BorrowBack: BorrowBackTpl,
                WaybillMaintenance: WaybillMaintenanceTpl,
                WaybillReconciliation: WaybillReconciliationTpl,
                GiftOut: GiftOutTpl,
                SocialApply: SocialApplyTpl,
                SellIntention: SellIntentionTpl,
                ComplimentaryOut: ComplimentaryOutTpl,
                ContractAgreement: ContractAgreementTpl,
                Distributormargin: DistributormarginTpl,
                SettlementOfServiceExpenses:SettlementOfServiceExpensesTpl
            };
            return resObj[val];
        })
        .service("dolphinPrintServer", ["$compile", "$rootScope", "$timeout", "$q", "$filter", "$controller", function ($compile, $rootScope, $timeout, $q, $filter, $controller) {
            function fnGetHTMLPrintTemplates($scope, printParam) {
                var scope = $scope.$new(true);
                var defer = $q.defer();
                scope.parentScopeParam = printParam;
                var adaptController = $controller('AdaptCtrl');
                var printTemplates = [];
                var template = "<div  ng-controller='ParseTemplateCtrl' id='print-template'>" +
                    "<div ng-include='templateUrl' ng-show='false'></div>" +
                    "</div>";

                adaptController.SubscribeEvent("templateStatus", subscribeTemplateEventCallback);

                if (!!document.getElementById("print-template")) {
                    removeTemplateDom();
                }
                document.getElementsByTagName("body")[0].appendChild($compile(angular.element(template))(scope)[0]);

                function parseHTMLTemplates() {
                    var templates = [];
                    $timeout(function () {
                        printTemplates = document.getElementsByClassName("print-template-item");
                        angular.forEach(printTemplates, function (item) {
                            var innerHTML = $filter('deleteHTMLComment')(item.innerHTML);
                            templates.push(innerHTML);
                        });
                        if (templates.length > 0) {
                            defer.resolve(templates);
                        } else {
                            defer.reject("模版元素获取失败！");
                        }
                        clearResource();
                    }, 10);
                }

                function removeTemplateDom() {
                    angular.element(document.getElementById("print-template")).remove();
                }

                function subscribeTemplateEventCallback(data) {
                    if (data.status === "success") {
                        parseHTMLTemplates();
                    } else {
                        defer.reject(data.value);
                        clearResource();
                    }
                }

                function clearResource() {
                    scope.$destroy();
                    scope = null;
                    adaptController.UnsubscribeEvent("templateStatus", subscribeTemplateEventCallback);
                    removeTemplateDom();
                }

                return defer.promise;
            }

            return {
                getHTMLPrintTemplates: fnGetHTMLPrintTemplates
            };
        }])
        .filter('deleteHTMLComment', function () {
            return function (sHtml) {
                var step1 = sHtml.replace(/<!--[\w\W\r\n]*?-->/gmi, '').replace(/(?=ng-repeat|ng-if|class)\b[^\s]+=["'][^"]*["'](?=\s|>)/gmi, '');
                return step1;
            }
        })
        .controller("AdaptCtrl", ["ybHttp", "ybWidget", "EventBus", function (ybHttp, ybWidget, EventBus) {

            function fnShowMessage(msg) {
                ybWidget.ShowMessage(msg);
            }

            function fnSubscribeEvent(evt, fn) {
                EventBus.Subscribe(evt, fn);
            }

            function fnUnsubscribeEvent(evt, fn) {
                EventBus.Unsubscribe(evt, fn);
            }

            function fnPublishEvent(evt, data) {
                EventBus.Publish(evt, data);
            }

            function fnGetHttpGetMethod() {
                return ybHttp.Get;
            }

            function fnGetHttpPostMethod() {
                return ybHttp.Post;
            }

            function fnSum(arg1, arg2) {
                return ybWidget.Plus(arg1, arg2);
            }

            function fnAccMul(arg1, arg2) {
                return Number(ybWidget.Times(arg1, arg2));
            }

            return {
                ShowMessage: fnShowMessage,
                SubscribeEvent: fnSubscribeEvent,
                UnsubscribeEvent: fnUnsubscribeEvent,
                PublishEvent: fnPublishEvent,
                GetHttpGetMethod: fnGetHttpGetMethod,
                GetHttpPostMethod: fnGetHttpPostMethod,
                Sum: fnSum,
                AccMul: fnAccMul
            }

        }])
        .controller("LodopServiceCtrl", ["$rootScope", "UserContextService", function ($rootScope, UserContextService) {

            var pageName = $rootScope.allowI18n && $rootScope.isEN ? 'Page #/&' : '页码 #/&';

            var lodop = null;

            var htmlTemplates = [];
            var templatePrintPaperInfo = {};

            async function fnLodopPrintOrPreview (params) {
                lodop = UserContextService.GetLodop();
                if (!lodop) {
                    return;
                }

                if (!await UserContextService.InitPrinter(lodop)) {
                    return;
                }

                htmlTemplates = params.list;
                templatePrintPaperInfo = params.tempaltePrintPaper;

                if (params.type === "print") {
                    sendPrintMessage(params);
                }
                if (params.type === "preview") {
                    sendPreviewMessage(params);
                }
            }

            function sendPrintMessage(params) {
                lodopMeths(params);

                lodop.PRINT();
            }

            function sendPreviewMessage(params) {
                lodopMeths(params);

                lodop.SET_SHOW_MODE("PREVIEW_IN_BROWSE", false);
                lodop.PREVIEW();
            }

            function lodopMeths(params) {
                lodop.ADD_PRINT_TEXT(3, 3, 70, 22, pageName);
                lodop.SET_PRINT_STYLEA(0, "ItemType", 2); // 页号项，每页输出

                //发运交接单，如果当前登录是挖机，则打印时每页页脚增加五联
                if (params.printType === "Handover") {
                    if ($rootScope.isWJ) {
                        lodop.ADD_PRINT_TEXT(3, 73, 700, 22, "一联(白):备件仓库 二联(红):出门证 三联(绿):随货装箱 四联(蓝):代理商 五联(黄):签收回单 六联(白):承运商");
                        lodop.SET_PRINT_STYLEA(0, "ItemType", 1); //页眉页脚项，每页输出
                        templatePrintPaperInfo.pageMargin.top+=3;
                    }
                }


                var isNeedCompress = params.isPrintLine || false;

                if (!!templatePrintPaperInfo && !!templatePrintPaperInfo.Width) {
                    lodop.SET_PRINT_PAGESIZE(templatePrintPaperInfo.Orient, templatePrintPaperInfo.Width + 'cm', templatePrintPaperInfo.Height + 'cm', "");
                    lodop.SET_PRINT_MODE("RESELECT_PRINTER", true);
                    lodop.SET_PRINT_MODE("RESELECT_ORIENT", true);
                    lodop.SET_PRINT_MODE("RESELECT_PAGESIZE", true);
                    lodop.SET_PRINT_MODE("RESELECT_COPIES", true);
                    if (isNeedCompress) {
                        lodop.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW", true);
                        lodop.SET_PRINT_MODE("FULL_HEIGHT_FOR_OVERFLOW", true);
                    }
                }

                if (!isNeedCompress) {
                    setPrintContentInfo();
                } else {
                    setCompressPrintContentInfo();
                }
            }

            function setPrintContentInfo() {
                var pageMargin = getPageMargin();
                angular.forEach(htmlTemplates, function (htmlTemplateStr) {
                    lodop.ADD_PRINT_TABLE(pageMargin.top, pageMargin.left, pageMargin.right, pageMargin.bottom, htmlTemplateStr); // 增加表格打印项 上左右下边距
                    lodop.NEWPAGEA();
                });
            }

            function setCompressPrintContentInfo() {
                var pageMargin = getPageMargin();
                pageMargin = preventCompressPrintBlank(pageMargin);
                angular.forEach(htmlTemplates, function (htmlTemplateStr) {
                    lodop.ADD_PRINT_HTM(pageMargin.top, pageMargin.left, pageMargin.right, pageMargin.bottom, htmlTemplateStr); // 增加表格打印项 上左右下边距
                    lodop.NEWPAGEA();
                });
            }

            function getPageMargin() {
                var topMargin = "";
                var leftMargin = "";
                var rightMargin = "";
                var bottomMargin = "";
                if (!templatePrintPaperInfo || angular.isUndefined(templatePrintPaperInfo.pageMargin)) { //兼容
                    topMargin = "3mm";
                    leftMargin = "2mm";
                    rightMargin = "RightMargin:2mm";
                    bottomMargin = "BottomMargin:1mm";
                } else {
                    topMargin = (templatePrintPaperInfo.pageMargin.top || 0) + "mm";
                    leftMargin = (templatePrintPaperInfo.pageMargin.left || 0) + "mm";
                    rightMargin = "RightMargin:" + (templatePrintPaperInfo.pageMargin.right || 0) + "mm";
                    bottomMargin = "BottomMargin:" + (templatePrintPaperInfo.pageMargin.bottom || 0) + "mm";
                }

                return {
                    top: topMargin,
                    left: leftMargin,
                    right: rightMargin,
                    bottom: bottomMargin
                }
            }

            function preventCompressPrintBlank(pageMargin) {
                var top = parseFloat(pageMargin.top);
                if (top < 1) {
                    pageMargin.top = '1mm';
                    return pageMargin;
                }
                return pageMargin;
            }

            return {
                LodopPrintOrPreview: fnLodopPrintOrPreview
            }
        }])
        .controller("ParseTemplateCtrl", ['$rootScope', '$scope', "$controller", "$timeout", "$filter", "$q", "DEFAULT_TEMPLATE_FUN","ybWidget",
            function ($rootScope, $scope, $controller, $timeout, $filter, $q, DEFAULT_TEMPLATE_FUN,ybWidget) {
                /* wangcan:第二张表，定义表格2模板 */
                $scope.previewTableData2 = [];

                $scope.multiLan = $rootScope.allowI18n;

                var adaptController = $controller('AdaptCtrl');
                var currentPrintProxy = null;

                $scope.templateUrl = "view/print/templateTable.html";
                $scope.printTempInfo = {};
                $scope.printTempStyle = {};

                $scope.printTempSelfFoot = {};
                $scope.printTable = [];
                $scope.printTableHeader = [];
                $scope.printTableFooter = [];

                function initGlobalVariable() {
                    $scope.printTempInfo = {
                        TempTitle: {
                            Name: '默认模板',
                            FontSize: '20',
                            nameDescheadFontSize: '14',
                            FontWeight: true,
                            nameDescFontWeight: false,
                        },
                        contentSetting: {
                            isPrintHead: false,
                            isPrintFoot: false,
                            tHeadCounts: 0,
                            tFootCounts: 0
                        }
                    };
                    /*内容排版*/
                    $scope.printTempStyle = {
                        WordWrap: true, //是否换行
                        FontSize: '14', //字体大小
                        IsFixedLineNumber: false, //是否启用固定行数
                        FixedLineNumber: 7, //固定行数
                        IsSmallCode: false, //小条码
                        SetHeaderColumn: '2', //表头行列个数
                        SetFootColumn: '2', //表尾行列个数
                        LineHeight: "7", //行高
                        HeadAndFootLineHeight: 20 //表头表尾行高
                    };
                    $scope.printTable = [];
                    $scope.printTableHeader = [];
                    $scope.printTableFooter = [];
                    /*自定义页尾*/
                    $scope.printTempSelfFoot = {
                        name: "自定义表尾",
                        value: ""
                    };

                    $scope.OrderInfo = [];
                }

                function receiveMessageToPrint() {
                    initGlobalVariable();

                    const templateObj = $scope.parentScopeParam?.template || {};
                    setTemplateUrl(templateObj);
                    $q.all([getTemplateInfoById(templateObj.Id), getPrintTableData()]).then(function (resultes) {
                        if (!resultes[0] || !resultes[1]) {
                            adaptController.PublishEvent("", {
                                status: "failed",
                                value: "模版或者单据数据获取失败"
                            });
                            return;
                        }
                        angular.forEach($scope.OrderInfo, function (item) {
                            item.OrderItem = item.materialList;
                        });
                        if ($scope.printTempStyle.IsFixedLineNumber) {
                            multitaskPrint();
                        }
                        $timeout(function () {
                            $scope.$digest();
                            adaptController.PublishEvent("templateStatus", {
                                status: "success"
                            });
                        }, 0);
                    });
                }

                function multitaskPrint() {
                    var OrderInfo = angular.copy($scope.OrderInfo);
                    $scope.OrderInfo = [];
                    for (var i = 0; i < OrderInfo.length; i++) {
                        manualPage(OrderInfo[i]);
                    }
                }

                function setTemplateUrl(templateData) {
                    var isPrintOnlyHead = false;
                    var isPrintOnlyFoot = false;
                    var contentSetting = angular.fromJson(templateData.ContentSetting);
                    var isPrintLine = templateData.IsPrintLine;
                    if (!!contentSetting) {
                        isPrintOnlyHead = contentSetting.isPrintHead;
                        isPrintOnlyFoot = contentSetting.isPrintFoot;
                    }
                    var FixedAndHeadAndFoot = isPrintLine ? '1' : '0';
                    FixedAndHeadAndFoot += isPrintOnlyHead ? '1' : '0';
                    FixedAndHeadAndFoot += isPrintOnlyFoot ? '1' : '0';
                    currentPrintProxy = selectPrintHeadOrfootProxy[FixedAndHeadAndFoot];
                    if (!currentPrintProxy) {
                        return;
                    }
                    $scope.templateUrl = currentPrintProxy.templateUrl;
                }

                // 0 不勾选固定行  1 勾选固定行
                // 0 不勾选表头 1 勾选表头
                // 0 不勾选表尾 1 勾选表尾
                var selectPrintHeadOrfootProxy = {
                    '000': { // 不勾选固定行，不勾选表头，不勾选表尾
                        templateUrl: "view/print/templateTable.html"
                    },
                    '001': { // 不勾选固定行，不勾选表头，勾选表尾
                        templateUrl: "view/print/templateOnlyFootTable.html"
                    },
                    '010': { // 不勾选固定行 勾选表头 不勾选表尾
                        templateUrl: "view/print/templateOnlyHeadTable.html"
                    },
                    '011': { //不勾选固定行 勾选表头 勾选表尾
                        templateUrl: "view/print/templateOnlyHeadAndFootTable.html"
                    },
                    '100': { //勾选固定行 不勾选表头，不勾选表尾
                        templateUrl: "view/print/compressTemplateTable.html",
                        calcuPageSize: function (isSubtotal, fixedLineCounts, tHeadCounts, tFootCounts) {
                            if (isSubtotal) {
                                return fixedLineCounts - 2;
                            }
                            return fixedLineCounts;
                        },
                        calcuOrderCounts: function (isSubtotal, orderCount, tHeadCounts, tFootCounts) {
                            if (isSubtotal) {
                                return orderCount;
                            }
                            return orderCount + 1;
                        },
                        calcuEveryPagePrintCounts: function (fixedLineCounts, tHeadCounts, tFootCounts) {
                            var differPrintPageSizeInfo = {
                                firstPageSize: fixedLineCounts,
                                middlePageSize: fixedLineCounts,
                                lastPageSize: fixedLineCounts
                            };
                            return differPrintPageSizeInfo;
                        }
                    },
                    '110': { // 勾选固定行 勾选表头，不勾选表尾
                        templateUrl: "view/print/compressOnlyHeadTable.html",
                        calcuPageSize: function (isSubtotal, fixedLineCounts, tHeadCounts, tFootCounts) {
                            if (isSubtotal) {
                                return tHeadCounts + fixedLineCounts - 2;
                            }
                            return tHeadCounts + fixedLineCounts;
                        },
                        calcuOrderCounts: function (isSubtotal, orderCount, tHeadCounts, tFootCounts) {
                            if (isSubtotal) {
                                return tHeadCounts + orderCount;
                            }
                            return tHeadCounts + orderCount + 1;
                        },
                        calcuEveryPagePrintCounts: function (fixedLineCounts, tHeadCounts, tFootCounts) {
                            var differPrintPageSizeInfo = {
                                firstPageSize: fixedLineCounts,
                                middlePageSize: adaptController.Sum(fixedLineCounts, tHeadCounts),
                                lastPageSize: adaptController.Sum(fixedLineCounts, tHeadCounts)
                            };
                            return differPrintPageSizeInfo;
                        }
                    },
                    '101': { //勾选固定行 不勾选表头，勾选表尾
                        templateUrl: "view/print/compressOnlyFootTable.html",
                        calcuPageSize: function (isSubtotal, fixedLineCounts, tHeadCounts, tFootCounts) {
                            if (isSubtotal) {
                                return tFootCounts + fixedLineCounts - 2;
                            }
                            return tFootCounts + fixedLineCounts;
                        },
                        calcuOrderCounts: function (isSubtotal, orderCount, tHeadCounts, tFootCounts) {
                            if (isSubtotal) {
                                return tFootCounts + orderCount;
                            }
                            return tFootCounts + orderCount + 1;
                        },
                        calcuEveryPagePrintCounts: function (fixedLineCounts, tHeadCounts, tFootCounts) {
                            var differPrintPageSizeInfo = {
                                firstPageSize: adaptController.Sum(fixedLineCounts, tFootCounts),
                                middlePageSize: adaptController.Sum(fixedLineCounts, tFootCounts),
                                lastPageSize: fixedLineCounts
                            };
                            return differPrintPageSizeInfo;
                        }
                    },
                    '111': { //勾选固定行 勾选表头，勾选表尾
                        templateUrl: "view/print/compressOnlyHeadAndFoot.html",
                        calcuPageSize: function (isSubtotal, fixedLineCounts, tHeadCounts, tFootCounts) {
                            if (isSubtotal) {
                                return tHeadCounts + tFootCounts + fixedLineCounts - 2;
                            }
                            return tHeadCounts + tFootCounts + fixedLineCounts;
                        },
                        calcuOrderCounts: function (isSubtotal, orderCount, tHeadCounts, tFootCounts) {
                            if (isSubtotal) {
                                return orderCount + tFootCounts + tHeadCounts;
                            }
                            return orderCount + tFootCounts + tHeadCounts + 1;
                        },
                        calcuEveryPagePrintCounts: function (fixedLineCounts, tHeadCounts, tFootCounts) {
                            var differPrintPageSizeInfo = {
                                firstPageSize: adaptController.Sum(fixedLineCounts, tFootCounts),
                                middlePageSize: adaptController.Sum(adaptController.Sum(fixedLineCounts, tHeadCounts), tFootCounts),
                                lastPageSize: adaptController.Sum(fixedLineCounts, tHeadCounts)
                            };
                            return differPrintPageSizeInfo;
                        }
                    }
                };

                function calcuPrintPageSize() {
                    var fixedLineCounts = $scope.printTempStyle.FixedLineNumber;
                    var isSubtotal = $scope.printTempStyle.IsSubtotal;
                    var tHeadCounts = $scope.printTempInfo.contentSetting.tHeadCounts;
                    var tFootCounts = $scope.printTempInfo.contentSetting.tFootCounts;
                    return currentPrintProxy.calcuPageSize(isSubtotal, fixedLineCounts, tHeadCounts, tFootCounts);
                }

                function calcuOrderTotal(order) {
                    var isSubtotal = $scope.printTempStyle.IsSubtotal;
                    var orderCount = order.OrderItem.length;
                    var tHeadCounts = $scope.printTempInfo.contentSetting.tHeadCounts;
                    var tFootCounts = $scope.printTempInfo.contentSetting.tFootCounts;
                    return currentPrintProxy.calcuOrderCounts(isSubtotal, orderCount, tHeadCounts, tFootCounts);
                }

                function calcuPrintPage(order, differPrintPageSizeInfo) {
                    var orderCount = order.OrderItem.length;
                    if (Number(differPrintPageSizeInfo.firstPageSize) >= orderCount) {
                        return 1;
                    }
                    var middlePage = Math.ceil((orderCount - Number(differPrintPageSizeInfo.firstPageSize)) / Number(differPrintPageSizeInfo.middlePageSize));
                    return 1 + middlePage;
                }

                function calcuBlankLineCounts(pageCount, pageSize, orderCounts) {
                    var totalCounts = adaptController.AccMul(pageCount, pageSize);
                    return totalCounts - orderCounts;
                }

                function calcuEveryPagePrintCounts() {
                    var fixedLineCounts = $scope.printTempStyle.FixedLineNumber;
                    var isSubtotal = $scope.printTempStyle.IsSubtotal;
                    var tHeadCounts = $scope.printTempInfo.contentSetting.tHeadCounts;
                    var tFootCounts = $scope.printTempInfo.contentSetting.tFootCounts;
                    var differPrintPageSizeInfo = currentPrintProxy.calcuEveryPagePrintCounts(fixedLineCounts, tHeadCounts, tFootCounts);

                    if (isSubtotal) {
                        differPrintPageSizeInfo = calcuEverySubtotalPageSize(differPrintPageSizeInfo);
                    }
                    return differPrintPageSizeInfo;
                }

                function calcuEverySubtotalPageSize(differPrintPageSizeInfo) {
                    angular.forEach(differPrintPageSizeInfo, function (item, index) {
                        differPrintPageSizeInfo[index] = Number(item) - 2;
                    });
                    return differPrintPageSizeInfo;
                }

                function manualPage(order) {
                    var pageSize = calcuPrintPageSize();
                    var orderCounts = calcuOrderTotal(order);
                    var differPrintPageSizeInfo = calcuEveryPagePrintCounts();
                    var pageCount = calcuPrintPage(order, differPrintPageSizeInfo);
                    var blankLineCounts = calcuBlankLineCounts(pageCount, pageSize, orderCounts);
                    for (var i = 0; i < blankLineCounts; i++) {
                        order.OrderItem.push({});
                    }
                    for (var page = 0; page < pageCount; page++) {
                        //只有2頁
                        var currentOrderList = sliceOrderInfo(page, order, differPrintPageSizeInfo, pageCount);
                        var childOrder = transformManualPage(page, currentOrderList, order, pageCount);
                        $scope.OrderInfo.push(childOrder);
                    }
                }

                function sliceOrderInfo(index, order, differPrintPageSizeInfo, pageCount) {
                    var firstPageSize = differPrintPageSizeInfo.firstPageSize;
                    var tMiddleCounts = adaptController.AccMul(differPrintPageSizeInfo.middlePageSize, (index - 1));
                    if (index === 0) {
                        return order.OrderItem.slice(0, (index + 1) * firstPageSize);
                    }
                    if (index === pageCount - 1) {
                        var tfootsCounts = adaptController.Sum(firstPageSize, tMiddleCounts);
                        return order.OrderItem.slice(tfootsCounts);
                    }
                    var middleCountsStart = adaptController.Sum(firstPageSize, tMiddleCounts);
                    var tMiddleCountsEnd = adaptController.AccMul(differPrintPageSizeInfo.middlePageSize, index);
                    var middleCountsEnd = adaptController.Sum(firstPageSize, tMiddleCountsEnd);
                    return order.OrderItem.slice(middleCountsStart, middleCountsEnd);
                }

                function transformManualPage(currentIndex, currentOrderList, order, pageCount) {
                    var childOrder = angular.copy(order);
                    childOrder.subtotalSettlementValue = 0;
                    childOrder.subtotalTotalQty = 0;
                    childOrder.OrderItem = [];
                    childOrder.totalPage = pageCount;
                    childOrder.currentPageIndex = currentIndex + 1;
                    childOrder.isLastPage = (currentIndex === pageCount - 1) ? true : false;
                    for (var i = 0; i < currentOrderList.length; i++) {
                        var orderItem = currentOrderList[i];
                        if (!angular.equals({}, orderItem)) {
                            var settlementTotalValue = getFormatSettlementTotalValue(orderItem);
                            var allQty = orderItem.LargeQty || orderItem.MediumQty || orderItem.Qty || orderItem.AllQty; // 销售单、销退单AllQty
                            childOrder.subtotalSettlementValue = adaptController.Sum(childOrder.subtotalSettlementValue, settlementTotalValue);
                            childOrder.subtotalTotalQty = adaptController.Sum(childOrder.subtotalTotalQty, allQty);
                            childOrder.OrderItem.push(orderItem);
                        } else {
                            childOrder.OrderItem.push({});
                        }
                    }
                    return childOrder;
                }

                function getFormatSettlementTotalValue(orderItem) {
                    var settlementTotalkey = window.PrintData[$scope.printType].printTempBdDictionn;
                    if (angular.isUndefined(settlementTotalkey.SettlementTotalValue)) return 0;
                    settlementTotalkey = settlementTotalkey.SettlementTotalValue.Value.split('.')[1];
                    settlementTotalkey = 'unFormat' + settlementTotalkey;
                    return orderItem[settlementTotalkey] || 0;
                }

                $scope.$watch("printTable", function () {
                    if ($scope.printTable.length === 0 || angular.isDefined($scope.printTable[0].colWidth)) {
                        return;
                    }

                    var totalWidth = 0;
                    angular.forEach($scope.printTable, function (item) {
                        totalWidth += item.widthRate || 1;
                    });
                    angular.forEach($scope.printTable, function (item) {
                        item.colWidth = item.colWidth || Math.floor(((item.widthRate || 1) / totalWidth * 100)) + '%'
                    });
                });

                //获取模板信息
                function getTemplateInfoById(templateId) {
                    if (templateId === "0000") {
                        getDefaultTemplateInfo();
                        return $q.when(true);
                    }
                    //fixme:模板详情在模版列表中就返回了，因此可以不需要再请求一次了
                    var httpGet = adaptController.GetHttpGetMethod();
                    return httpGet('device', "/printTemplate/item", {
                        id: templateId
                    }).then(function (data) {
                        if (data.code !== 0) {
                            adaptController.ShowMessage(data);
                            return false;
                        }

                        setNormalTemplateData(data.value);
                        return true;
                    });
                }

                //获取默认模版信息
                function getDefaultTemplateInfo() {
                    $scope.printTempSelfFoot.value = "";
                    $scope.printTempInfo.TempTitle.Name = window.PrintData[$scope.printType].Name;
                    $scope.printTempStyle.IsSmallCode = false;
                    $scope.printTempStyle.WordWrap = true;
                    $scope.printTempInfo.TempTitle.FontWeight = true;
                    $scope.printTempInfo.nameDescheadFontSize = false;
                    initDefaultTemplateTableHeader();
                    initDefaultTemplateTableBody();
                }

                var currentTemplate = null;

                function getPrintDataField(dictionTypeName, fieldKeyName) {
                    return angular.copy(window.PrintData[$scope.printType][dictionTypeName][fieldKeyName])
                }

                function initDefaultTemplateTableHeader() {
                    var theaderList = currentTemplate.getTheader();
                    $scope.printTableHeader = [];
                    $scope.printTableFooter = [];
                    for (let headerItem of theaderList) {
                        var temp = getPrintDataField('cacheHeaderFootDiction', headerItem.keyName);
                        if (!temp) {
                            console.error("PrintData:cacheHeaderFootDiction里没有字段：" + headerItem.keyName);
                            return;
                        }
                        if (!headerItem.isChecked) {
                            continue;
                        }
                        temp.Key = headerItem.keyName;
                        temp.IsChecked = headerItem.isChecked;
                        temp.IsHeader = headerItem.isHeader;

                        if (headerItem.isHeader) {
                            $scope.printTableHeader.push(temp);
                        } else {
                            $scope.printTableFooter.push(temp);
                        }
                    }
                }

                function initDefaultTemplateTableBody() {
                    var tbodyList = currentTemplate.getTbody();
                    $scope.printTable = [];
                    for (let tbodyItem of tbodyList) {
                        var temp = getPrintDataField('printTempBdDiction', tbodyItem.keyName);
                        if (!temp) {
                            console.error("PrintData:printTempBdDiction里没有字段：" + tbodyItem.keyName);
                            return;
                        }
                        if (!tbodyItem.isChecked) {
                            continue;
                        }
                        temp.Key = tbodyItem.keyName;
                        temp.IsChecked = tbodyItem.isChecked;

                        if (!tbodyItem.bodyType || tbodyItem.bodyType == 1) {
                            // 默认走 “装箱前” 打印模板
                            $scope.printTable.push(temp);
                        }
                    }
                }

                /*填充normal模板信息*/
                function setNormalTemplateData(data) {
                    if (data.headMessage) {
                        $scope.printTempInfo.TempTitle.Name = data.headMessage;
                    }
                    $scope.printTempInfo.TempTitle.FontSize = data.headFontSize;
                    $scope.printTempInfo.TempTitle.nameDescheadFontSize = data.nameDescheadFontSize;
                    if (typeof data.isHeadlineFontBold !== undefined) {
                        $scope.printTempInfo.TempTitle.FontWeight = data.isHeadlineFontBold;
                    }
                    $scope.printTempInfo.TempTitle.NameDesc = data.headDesc; // 增加标题描述
                    if (typeof data.isNameDescFontBold !== undefined) {
                        $scope.printTempInfo.TempTitle.nameDescFontWeight = data.isNameDescFontBold;
                    }

                    $scope.printTempInfo.printPaper = angular.fromJson(data.pageSetting);
                    if (data.bottomMessage && angular.isString(data.bottomMessage)) {
                        var regExp = new RegExp("  ", "g"); //创建正则RegExp对象
                        $scope.printTempSelfFoot.value = data.bottomMessage.replace(regExp, '&emsp;');
                    }
                    $scope.printTempStyle.lineHeight = data.lineHeight !== '0' ? $filter('convertMMToPx')(data.lineHeight) : 25;
                    $scope.printTempStyle.IsSmallCode = data.isPrintMinCode;
                    $scope.printTempStyle.IsSubtotal = data.isPrintPageSubtotal;
                    $scope.printTempStyle.IsFixedLineNumber = data.isPrintLine;
                    var contentSetting = angular.fromJson(data.contentSetting);
                    if (!!contentSetting) {
                        $scope.printTempInfo.contentSetting = contentSetting;
                        $scope.printTempStyle.HeadAndFootLineHeight = contentSetting.HeadAndFootLineHeight ? $filter('convertMMToPx')(contentSetting.HeadAndFootLineHeight) : 20;
                    }
                    if (!!data.isPrintLine) {
                        $scope.printTempStyle.FixedLineNumber = data.printLineNum;
                    }

                    if (typeof data.isBodyAutoLineWrap !== undefined) {
                        $scope.printTempStyle.WordWrap = data.isBodyAutoLineWrap;
                    }
                    if (data.bodyFontSize) {
                        $scope.printTempStyle.FontSize = data.bodyFontSize;
                    }
                    if (data.headerColumnNum) {
                        $scope.printTempStyle.SetHeaderColumn = data.headerColumnNum;
                    }
                    if (data.footerColumnNum) {
                        $scope.printTempStyle.SetFootColumn = data.footerColumnNum;
                    }

                    setPrintTableHeaderFooterInfo(data.headerFooterColumnInfo);
                    setPrintTableInfo(data.bodyColumnInfo);
                }

                function setPrintTableHeaderFooterInfo(headerFooterColumnInfo) {
                    if (!headerFooterColumnInfo) {
                        return;
                    }
                    var columnInfo = angular.fromJson(headerFooterColumnInfo);
    
                    $scope.printTempStyle.SetAlwaysShowHeadFoot = columnInfo.alwaysShowHeadFoot || false;

                    $scope.printTableHeader = [];
                    $scope.printTableFooter = [];
                    for(let headerItem of columnInfo.cahcheHeaderList.concat(columnInfo.cahcheFootList)) {
                        var temp = getPrintDataField('cacheHeaderFootDiction', headerItem.Key);
                        if (!temp) continue;
    
                        if (!headerItem.IsChecked) {
                            continue;
                        }
                        temp.Key = headerItem.Key;
                        temp.IsChecked = headerItem.IsChecked;
                        temp.IsHeader = headerItem.IsHeader;
                        temp.IsAloneRow = headerItem.IsAloneRow;
                        temp.Alias = headerItem.Alias;

                        if (headerItem.IsHeader) {
                            $scope.printTableHeader.push(temp);
                        } else {
                            $scope.printTableFooter.push(temp);
                        }
                    }
                }

                function setPrintTableInfo(bodyColumnInfo) {
                    if (!bodyColumnInfo) {
                        return;
                    }
    
                    var bodyColumnList = angular.fromJson(bodyColumnInfo);

                    $scope.printTable = [];
                    for (var i = 0; i < bodyColumnList.length; i++) {
                        var tbodyItem = bodyColumnList[i];
                        var temp = getPrintDataField('printTempBdDiction', tbodyItem.Key);
                        if (!temp) continue;
    
                        if (!tbodyItem.IsChecked) {
                            continue;
                        }
                        temp.Key = tbodyItem.Key;
                        temp.IsChecked = tbodyItem.IsChecked;
                        temp.Alias = tbodyItem.Alias;
                        if (angular.isDefined(tbodyItem.colWidth)) {
                            temp.colWidth = tbodyItem.colWidth;
                        }
    
                        $scope.printTable.push(temp);
                    }
                }

                // printNeed 根据接口区分模版类型转化字段
                function dealField(url, value) {
                    switch (url) {
                        case '/deliveryNote/itemList':
                            angular.forEach(value, function (item) {
                                item.headerInfo.qrcode = item.headerInfo.deliveryNo;
                                item.headerInfo.reviewState =  $filter("ProgressStatus")(item.headerInfo.reviewState, "auditDeliveryNotice");
                                item.headerInfo.auditDate = $filter("YbDate")(item.headerInfo.auditDate, 'yyyy-MM-dd HH:mm:ss');
                                item.headerInfo.createDate = $filter('YbDate')(item.headerInfo.createDate);
                                item.headerInfo.updateStateDate = $filter('YbDate')(item.headerInfo.updateStateDate);
                                item.headerInfo.printDate = $filter('YbDate')(new Date());
                                angular.forEach(item.materialList, function (item, index) {
                                    item.noCus = index + 1
                                });
                            });
                            break;
                        case '/abnormalOut/item':
                            value.headerInfo.qrcode = value.headerInfo.abnormalNo;
                            value.headerInfo.isSynsap = value.headerInfo.isSynsap ? '是' : '否';
                            value.headerInfo.isSynsapSuccess = $filter("ProgressStatus")(value.headerInfo.isSynsapSuccess, "sap");
                            value.headerInfo.status = $filter("ProgressStatus")(value.headerInfo.status, "outDepot");
                            value.headerInfo.applicationDate = $filter('YbDate')(value.headerInfo.applicationDate, "yyyy-MM-dd HH:mm:ss");

                            value.headerInfo.auditDate = $filter('YbDate')(value.headerInfo.auditDate, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.auditStatus = $filter("AuditStatus2")(value.headerInfo.auditStatus);

                            angular.forEach(value.materialList, function (item) {
                                item.status = $filter("ProgressStatus")(item.status, "outDepot");
                                item.realQty = null;
                            });
                            break;
                        case '/abnormalIn/item':
                            value.headerInfo.qrcode = value.headerInfo.abnormalNo;
                            value.headerInfo.isSynsap = value.headerInfo.isSynsap ? '是' : '否';
                            value.headerInfo.isSynsapSuccess = $filter("ProgressStatus")(value.headerInfo.isSynsapSuccess, "sap");
                            value.headerInfo.state = $filter("ProgressStatus")(value.headerInfo.state, "inDepot");
                            value.headerInfo.applicationDate = $filter('YbDate')(value.headerInfo.applicationDate, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.voucherStatus = !!value.headerInfo.voucherNo ? "已过账" : "未过账";
                            
                            value.headerInfo.auditDate = $filter('YbDate')(value.headerInfo.auditDate, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.auditStatus = $filter("AuditStatus2")(value.headerInfo.auditStatus);

                            value.materialList = value.detailList || [];

                            let sumTotalPriceTemp = 0;
                            angular.forEach(value.materialList, function (item) {
                                item.state = $filter("ProgressStatus")(item.state, "inDepot");
                                item.realQty = null;
                                sumTotalPriceTemp += item.totalPrice;
                            });
                            value.headerInfo.sumTotalPrice = $filter("decimalCover")(sumTotalPriceTemp, 2);
                            break;
                        case '/threeGuaranteesOut/item':
                        case '/complimentaryOut/item':
                        case '/complimentaryOut/itemDetail':    
                        case '/threeGuaranteesOut/itemDetail':
                            value.headerInfo.qrcode = value.headerInfo.guaranteesOutNo;
                            value.headerInfo.printTimeCus = $filter('YbDate')(new Date(), "yyyy-MM-dd HH:mm");

                            value.headerInfo.createDate = $filter('YbDate')(value.headerInfo.createDate, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.outLocationStatus = $filter('ProgressStatus')(value.headerInfo.outLocationStatus, "outDepot");
                            value.materialList = value.detailList;

                            if (value.headerInfo.auditVO) {
                                if (value.headerInfo.auditVO.auditInfo) {
                                    value.headerInfo.auditsName = value.headerInfo.auditVO.auditInfo.map(a=>a.auditName);
                                }
                                value.headerInfo.auditLeaderName = value.headerInfo.auditVO.leaderName;
                            }

                            angular.forEach(value.materialList, function (item) {
                                item.status = $filter("ProgressStatus")(item.outLocationStatus, "outDepot");
                                item.realOutQty = null;
                            });
                            break;
                        case '/agentAllot/item':
                            value.headerInfo.qrcode = value.headerInfo.allotOrder;
                            value.headerInfo.createDate = $filter('YbDate')(value.headerInfo.createDate);
                            value.headerInfo.deliveryDate = $filter('YbDate')(value.headerInfo.deliveryDate);
                            value.headerInfo.verifyState = $filter('ProgressStatus')(value.headerInfo.verifyState, "verifyState");
                            value.headerInfo.auditDate = $filter('YbDate')(value.headerInfo.auditDate);
                            value.materialList = value.detailList || [];
                            value.headerInfo.sumTotalPrice = $filter("decimalCover")(value.materialList.reduce((sum, cur) => sum + (cur.totalPrice || 0), 0), 2);
                            break;
                        case '/returnApply/item':
                            value.materialList = angular.copy(value.returnApplyDetailVOs);
                            value.headerInfo = value;
                            value.headerInfo.qrcode = value.headerInfo.applyNo;
                            value.headerInfo.createDate = $filter('YbDate')(value.headerInfo.createDate);
                            break;
                        case '/deliveryReceipt/item':
                        case '/deliveryReceipt/printWithUpdate':
                            value.headerInfo = value.deliveryReceiptVO;
                            value.headerInfo.qrcode = value.headerInfo.billNo;

                            value.headerInfo.serviceNos = value.deliveryReceiptVO.serviceNo;

                            value.headerInfo.deliveryNOs = '';
                            value.headerInfo.saleBillNos = '';
                            value.headerInfo.prodTypes = '';
                            value.headerInfo.machineNumbers = '';
                            value.headerInfo.crmOrders = '';
                            value.headerInfo.serviceNames = '';
                            value.headerInfo.serviceSites = '';

                            value.headerInfo.auditName = value.deliveryReceiptVO.auditName;
                            value.headerInfo.auditDate = $filter('YbDate')(value.deliveryReceiptVO.auditDate, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.auditStatus = $filter("ProgressStatus")(Number(value.deliveryReceiptVO.auditStatus)-1, "auditStatus");

                            //车号去重
                            var machineArray = value.billList.map((bill)=>{
                                var threeGuaServiceVO = bill.threeGuaServiceVO || {};
                                return threeGuaServiceVO.machineNumber
                            })
                    
                            machineArray = Array.from(new Set(machineArray));
                            value.headerInfo.machineNumbers = machineArray.join(",");

                            angular.forEach(value.billList, function (item, index) {
                                value.headerInfo.deliveryNOs += item.deliveryNoteNo;
                                value.headerInfo.saleBillNos += item.saleBillNo||'';
                                var threeGuaServiceVO = item.threeGuaServiceVO || {};
                                value.headerInfo.prodTypes += (threeGuaServiceVO.prodType || '');
                                // value.headerInfo.machineNumbers += (threeGuaServiceVO.machineNumber || '');
                                value.headerInfo.crmOrders += (threeGuaServiceVO.crmOrder || '');
                                value.headerInfo.serviceNames += (threeGuaServiceVO.serviceName || '');
                                value.headerInfo.serviceSites += (threeGuaServiceVO.serviceSite || '');
                                if (index + 1 < value.billList.length) {
                                    value.headerInfo.deliveryNOs += ',';
                                    value.headerInfo.saleBillNos += ',';
                                    value.headerInfo.prodTypes += ',';
                                    // value.headerInfo.machineNumbers += ',';
                                    value.headerInfo.crmOrders += ',';
                                    value.headerInfo.serviceNames += ',';
                                    value.headerInfo.serviceSites += ',';
                                }
                            });
                            value.headerInfo.serviceNames = Array.from(new Set(value.headerInfo.serviceNames.split(',').filter(Boolean))).join(',');
                            value.headerInfo.serviceSites = Array.from(new Set(value.headerInfo.serviceSites.split(',').filter(Boolean))).join(',');
                            value.headerInfo.createDate = $filter('YbDate')(value.headerInfo.createDate);
                            value.headerInfo.deliveryDate = $filter('YbDate')(value.headerInfo.deliveryDate);
                            value.headerInfo.salesType = value.headerInfo.salesType == 0 ? '正常销售' : '三包';
                            if ($rootScope.isWJ) {
                                value.headerInfo.remark = value.deliveryReceiptVO.prRemark
                            }
                            value.headerInfo.purchaseTypeShow = `${value.deliveryReceiptVO.purchaseTypeName||''}${value.deliveryReceiptVO.purchaseTypeChildName?'-':''}${value.deliveryReceiptVO.purchaseTypeChildName||''}`;
                            
                            var tempInfo = angular.fromJson(localStorage.getItem("S_Templates"));

                            if ($scope.printType === 'Handover') {
                                // 打印发运交接单（打印按钮）

                                var bodyTypeT = 1; // 默认走 “装箱前” 打印模板
                                var jsonData = angular.fromJson(tempInfo.BodyColumnInfo);
                                if (jsonData) {
                                    bodyTypeT = jsonData[0].bodyType;
                                }
                                if (bodyTypeT === 1) {
                                    // 装箱前
                                    value.materialList = value.materialsMergeList
                                } else if (bodyTypeT === 2) {
                                    // 装箱后
                                    value.materialList = value.materialsList;
                                }
                                angular.forEach(value.materialList, function (item, index) {
                                    item.noCus = index + 1;
                                    if (!item.realAmount || parseFloat(item.realAmount) <= 0) {
                                        item.realAmount = null;
                                    }
                                    item.useOnsiteMaterial = $filter("TrueOrFalse")(item.useOnsiteMaterial);
                                });
                            } else if ($scope.printType === 'Encasement') {
                                // 打印装箱清单（打印装箱清单按钮）
                                value.materialList = value.mainVOList;
                                angular.forEach(value.materialList, function (item) {
                                    if (!item.lenghtNum) {
                                        item.lenghtNum = '';
                                    }
                                    if (!item.withNum) {
                                        item.withNum = '';
                                    }
                                    if (!item.hightNum) {
                                        item.hightNum = '';
                                    }
                                    if (!item.roughWeight) {
                                        item.roughWeight = '';
                                    }
                                    if (!item.weight) {
                                        item.weight = '';
                                    }
                                    item.measurement = item.lenghtNum + '/' + item.withNum + '/' + item.hightNum;
                                    item.WT = item.roughWeight + '/' + item.weight;
                                    item.createTimeShow = $filter('YbDate')(item.createTime, "yyyy-MM-dd HH:mm:ss");
                                });
                            }
                            break;
                        case '/boxupPack/getItemInfo':
                            value.headerInfo = value;
                            value.headerInfo.qrcode = value.packNo; // 打包单号
                            value.headerInfo.checkTime = $filter('YbDate')(value.checkTime, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.createTime = $filter('YbDate')(value.createTime, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.deliveryStatus = $filter('BoxupPackDeliveryStatus')(value.deliveryStatus);
                            value.headerInfo.deliveryTime = $filter('YbDate')(value.deliveryTime, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.updateTime = $filter('YbDate')(value.updateTime, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.status = $filter("ProgressStatus")(value.status, 'boxupPackStatus');
                            value.headerInfo.requireDeliveryTime = $filter('YbDate')(value.requireDeliveryTime, "yyyy-MM-dd");
                        
                            angular.forEach(value.boxupPackDetailVOList, function (item, index) {
                                item.noCus = index + 1;
                                item.createTime = $filter('YbDate')(item.createTime, "yyyy-MM-dd HH:mm:ss");
                                item.deliveryStatus = $filter('BoxupPackDetailDeliveryStatus')(item.deliveryStatus);
                                item.rwT = `${item.roughWeight || ''}/${item.weight || ''}`;
                                item.lwhT = `${item.lenghtNum || ''}/${item.withNum || ''}/${item.hightNum || ''}`;
                            });    

                            value.materialList = value.boxupPackDetailVOList;
                            break;
                        case '/deliveryReceipt/item4Print':
                        case '/deliveryReceipt/item4DlAndZl':
                            angular.forEach(value, function (item) {
                                item.headerInfo = item || {};
                                item.headerInfo.boxNo = `${item.boxNo}`;
                                item.headerInfo.qrcode = item.boxupNo;
                                item.headerInfo.mjweight = `${item.roughWeight||''}/${item.weight||''}KG`;
                                item.headerInfo.lwh = `${item.lenghtNum||''}*${item.withNum||''}*${item.hightNum||''}MM`;
                                item.headerInfo.createTimeShow = $filter('YbDate')(item.createTime, "yyyy-MM-dd HH:mm:ss");
                                angular.forEach(item.materialsList, function (item, index) {
                                    item.noCus = index + 1
                                });
                                item.materialList = item.materialsList;
                            });
                            break;
                        case '/deliveryReceipt/batch4Print':
                            angular.forEach(value, function (item) {
                                item.headerInfo = item || {};
                                item.headerInfo.qrcode = item.boxupNo;
                                item.headerInfo.mjweight = `${item.roughWeight||''}/${item.weight||''}KG`;
                                item.headerInfo.lwh = `${item.lenghtNum||''}*${item.withNum||''}*${item.hightNum||''}MM`;
                                item.headerInfo.createTimeShow = $filter('YbDate')(item.createTime, "yyyy-MM-dd HH:mm:ss");
                                angular.forEach(item.materialsList, function (item, index) {
                                    item.noCus = index + 1
                                });
                                item.materialList = item.materialsList;
                            });
                            break;
                        case '/materialsSchedule/item':
                        case '/materialsSchedule/itemDetail':
                            var typeStr = value.headerInfo.type == 1 ? "outDepot" : "inDepot";
                            value.headerInfo.qrcode = value.headerInfo.requisitionNo;
                            value.headerInfo.printTimeCus = $filter('YbDate')(new Date(), "yyyy-MM-dd HH:mm");

                            value.headerInfo.createDate = $filter('YbDate')(value.headerInfo.createDate, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.status = $filter('ProgressStatus')(value.headerInfo.status, typeStr);
                            value.headerInfo.voucherInStatus = !!value.headerInfo.voucherInNo ? "已过账" : "未过账";
                            value.headerInfo.voucherOutStatus = !!value.headerInfo.voucherOutNo ? "已过账" : "未过账";

                            value.headerInfo.auditDate = $filter('YbDate')(value.headerInfo.auditDate, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.auditStatus = $filter('AuditStatus2')(value.headerInfo.auditStatus);

                            if (value.headerInfo.auditVO) {
                                if (value.headerInfo.auditVO.auditInfo) {
                                    value.headerInfo.auditsName = value.headerInfo.auditVO.auditInfo.map(a=>a.auditName);
                                }
                                value.headerInfo.auditLeaderName = value.headerInfo.auditVO.leaderName;
                            }

                            value.materialList = value.detailList;
                            angular.forEach(value.materialList, function (item) {
                                item.status = $filter("ProgressStatus")(item.status, typeStr);
                                item.realAmount = null;
                            });
                            break;
                        case '/materialsSchedule/itemGroupByOutLocation':
                            angular.forEach(value, function (valueObj) {
                                var typeStr = valueObj.headerInfo.type == 1 ? "outDepot" : "inDepot";
                                valueObj.headerInfo.qrcode = valueObj.headerInfo.requisitionNo;
                                valueObj.headerInfo.printTimeCus = $filter('YbDate')(new Date(), "yyyy-MM-dd HH:mm");

                                valueObj.headerInfo.createDate = $filter('YbDate')(valueObj.headerInfo.createDate, "yyyy-MM-dd HH:mm:ss");
                                valueObj.headerInfo.status = $filter('ProgressStatus')(valueObj.headerInfo.status, typeStr);
                                valueObj.headerInfo.voucherInStatus = !!valueObj.headerInfo.voucherInNo ? "已过账" : "未过账";
                                valueObj.headerInfo.voucherOutStatus = !!valueObj.headerInfo.voucherOutNo ? "已过账" : "未过账";

                                valueObj.headerInfo.auditDate = $filter('YbDate')(valueObj.headerInfo.auditDate, "yyyy-MM-dd HH:mm:ss");
                                valueObj.headerInfo.auditStatus = $filter('AuditStatus2')(valueObj.headerInfo.auditStatus);

                                if (valueObj.headerInfo.auditVO) {
                                    if (valueObj.headerInfo.auditVO.auditInfo) {
                                        valueObj.headerInfo.auditsName = valueObj.headerInfo.auditVO.auditInfo.map(a=>a.auditName);
                                    }
                                    valueObj.headerInfo.auditLeaderName = valueObj.headerInfo.auditVO.leaderName;
                                }

                                valueObj.materialList = valueObj.detailList;
                                angular.forEach(valueObj.materialList, function (item) {
                                    item.status = $filter("ProgressStatus")(item.status, typeStr);
                                    item.realAmount = null;
                                });
                            })
                            break;
                        case '/inventoryCheck/printItem':
                            value.headerInfo.qrcode = value.headerInfo.checkOrderNo;
                            value.headerInfo.inventoryDes = value.headerInfo.checkOrderDes;

                            value.headerInfo.checkStatus = $filter('inventoryCheck')(value.headerInfo.status);
                            value.headerInfo.checkType = $filter('ProgressStatus')(value.headerInfo.checkType, "checkType");
                            if (value.detailList.length > 0) {
                                value.headerInfo.custodian = value.detailList[0].depositaryName;
                            }

                            value.headerInfo.plannedDate = $filter('YbDate')(value.headerInfo.plannedDate);
                            value.headerInfo.createDate = $filter('YbDate')(value.headerInfo.createDate);
                            value.materialList = value.detailList;
                            angular.forEach(value.materialList, function (item) {
                                item.stateShow = $filter("checkState")(item.resultType);
                            });
                            break;
                        case '/purchaseInbound/item':
                            value.headerInfo.qrcode = value.headerInfo.purchaseInboundOrder;
                            value.headerInfo.inStatus = $filter('ProgressStatus')(value.headerInfo.status, "inDepot");
                            value.headerInfo.createDate = $filter('YbDate')(value.headerInfo.createDate, "yyyy-MM-dd HH:mm:ss");
                            value.materialList = value.detailList;
                            angular.forEach(value.materialList, function (item) {
                                item.qualifiedQuantity = "";
                                item.status = $filter("ProgressStatus")(item.status, "inDepot");
                                item.realAmount = null;
                            });
                            break;
                        case '/backInbound/item':
                            value.headerInfo.qrcode = value.headerInfo.inboundOrder;
                            value.headerInfo.inStatus = $filter('ProgressStatus')(value.headerInfo.status, "inDepot");
                            value.headerInfo.createDate = $filter('YbDate')(value.headerInfo.createDate, "yyyy-MM-dd HH:mm:ss");
                            angular.forEach(value.materialList, function (item) {
                                item.statusShow = $filter("ProgressStatus")(item.status, "inDepot");
                                item.realAmount = null;
                            });
                            break;
                        case '/initialInventory/item':
                            value.headerInfo.state = $filter("ProgressStatus")(value.headerInfo.state, "inDepot");
                            value.headerInfo.qrcode = value.headerInfo.billNo;
                            value.headerInfo.createDate = $filter('YbDate')(value.headerInfo.createDate, "yyyy-MM-dd HH:mm:ss");
                            value.materialList = value.detailList;
                            angular.forEach(value.materialList, function (item) {
                                item.stateDesc = $filter("ProgressStatus")(item.state, "inDepot");
                                item.inNum = null;
                            });
                            break;
                        case '/returnIn/item':
                            value.headerInfo = {
                                qrcode: value.returnNo,
                                returnNo: value.returnNo,
                                billTypeName: value.billTypeName,
                                applyNo: value.applyNo,
                                createName: value.createName,
                                dept: value.dept,
                                createTime: $filter('YbDate')(value.createTime, "yyyy-MM-dd HH:mm:ss"),
                                warehouseCode: value.warehouseCode,
                                areaCode: value.inArea,
                                inStatus: $filter('ProgressStatus')(value.status, "inDepot"),
                                note: value.note
                            };
                            value.materialList = value.returnInDetailVOs;
                            angular.forEach(value.materialList, function (item) {
                                item.statusShow = $filter("ProgressStatus")(item.status, "inDepot");
                                item.inQtyStr = '';
                            });
                            break;
                        case '/regionAllot/item':
                        case '/regionAllot/itemDetail':
                            value.headerInfo.qrcode = value.headerInfo.allotOrder;
                            value.headerInfo.printTimeCus = $filter('YbDate')(new Date(), "yyyy-MM-dd HH:mm");

                            value.headerInfo.createDate = $filter('YbDate')(value.headerInfo.createDate);

                            if (value.headerInfo.auditVO) {
                                if (value.headerInfo.auditVO.auditInfo) {
                                    value.headerInfo.auditsName = value.headerInfo.auditVO.auditInfo.map(a=>a.auditName);
                                }
                                value.headerInfo.auditLeaderName = value.headerInfo.auditVO.leaderName;
                            }

                            value.materialList = value.detailList;
                            break;
                        case '/deliveryInstruction/item':
                            value.headerInfo.qrcode = value.headerInfo.deliveryOrder;
                            value.headerInfo.state = $filter("ProgressStatus")(value.headerInfo.state, "inDepot");
                            value.headerInfo.postingState = $filter("ProgressStatus")(value.headerInfo.postingState, "posting");
                            value.headerInfo.createDate = $filter('YbDate')(value.headerInfo.createDate, "yyyy-MM-dd HH:mm:ss");
                            value.materialList = value.detailList;
                            angular.forEach(value.materialList, function (item) {
                                item.state = $filter("ProgressStatus")(item.state, "inDepot");
                                item.postingState = $filter("ProgressStatus")(item.postingState, "posting");
                                item.realAmount = null;
                            });
                            break;
                        case '/saleReverse/item':
                            value.headerInfo.qrcode = value.headerInfo.reverseOrder;
                            value.headerInfo.isPosting = !!value.headerInfo.isPosting ? "是" : "否";
                            value.headerInfo.auditState = $filter("ProgressStatus")(value.headerInfo.auditState, "audit");
                            value.headerInfo.auditDate = $filter('YbDate')(value.headerInfo.auditDate);
                            value.materialList = value.detailList;
                            angular.forEach(value.materialList, function (item) {
                                item.stateShow = $filter("ProgressStatus")(item.state, "inDepot");
                            });
                            break;
                        case '/split/item':
                            value.headerInfo.qrcode = value.headerInfo.splitOrder;
                            value.headerInfo.createDate = $filter("YbDate")(value.headerInfo.createDate, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.splitType = $filter("DismantlingType")(value.headerInfo.splitType);
                            value.headerInfo.splitStatus = $filter("DismantlingStatus")(value.headerInfo.splitStatus);
                            value.headerInfo.restoreStatus = $filter("RestoreStatus")(value.headerInfo.restoreStatus);
                            value.headerInfo.auditStatus = $filter("AuditStatus")(value.headerInfo.auditStatus);
                            value.headerInfo.firstAuditDate = $filter("YbDate")(value.headerInfo.firstAuditDate, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.secondAuditDate = $filter("YbDate")(value.headerInfo.secondAuditDate, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.thirdAuditDate = $filter("YbDate")(value.headerInfo.thirdAuditDate, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.fourthAuditDate = $filter("YbDate")(value.headerInfo.fourthAuditDate, "yyyy-MM-dd HH:mm:ss");
                            break;
                        case '/restore/item':
                            value.headerInfo.qrcode = value.headerInfo.restoreOrder;
                            value.headerInfo.createDate = $filter("YbDate")(value.headerInfo.createDate, "yyyy-MM-dd HH:mm:ss");
                            break;
                        case '/sendBill/item':
                            value.headerInfo.qrcode = value.headerInfo.sendOrder;
                            value.headerInfo.isSign = value.headerInfo.isSign ? '是' : '否';
                            value.headerInfo.isDelivery = value.headerInfo.isDelivery ? '是' : '否';
                            value.materialList = value.materialsList;
                            break;
                        case '/receiptIn/item':
                            value.headerInfo.qrcode = value.headerInfo.billNo;
                            value.headerInfo.status = $filter("ProgressStatus")(value.headerInfo.status, "inDepot");
                            angular.forEach(value.detailList, function (item) {
                                item.status = $filter("ProgressStatus")(item.status, "inDepot");
                            });
                            value.materialList = value.detailList;
                            break;
                        case '/backOutbound/item':
                            value.headerInfo.qrcode = value.headerInfo.inboundOrder;
                            value.headerInfo.inStatus = $filter('ProgressStatus')(value.headerInfo.status, "outDepot");
                            value.headerInfo.createDate = $filter('YbDate')(value.headerInfo.createDate, "yyyy-MM-dd HH:mm:ss");
                            angular.forEach(value.materialList, function (item) {
                                item.statusShow = $filter("ProgressStatus")(item.status, "outDepot");
                                item.realAmount = null;
                            });
                            break;
                        case '/threeReverse/item':
                            value.headerInfo.qrcode = value.headerInfo.reverseOrder;
                            value.headerInfo.auditState = (value.headerInfo.auditState !== null && value.headerInfo.auditState !== undefined && value.headerInfo.auditState !== "") ? $filter("ProgressStatus")(value.headerInfo.auditState, "audit") : '';
                            value.headerInfo.auditDate = value.headerInfo.auditDate ? $filter("YbDate")(value.headerInfo.auditDate, "yyyy-MM-dd HH:mm:ss") : '';
                            value.headerInfo.isPosting = $filter("TrueOrFalse")(value.headerInfo.isPosting);
                            value.headerInfo.isSapReverse = $filter("TrueOrFalse")(value.headerInfo.isSapReverse);
                            angular.forEach(value.detailList, function (item) {
                                item.auditDate = $filter("YbDate")(item.auditDate, "yyyy-MM-dd HH:mm:ss");
                                item.isPosting = $filter("TrueOrFalse")(item.isPosting);
                                item.isSapReverse = $filter("TrueOrFalse")(item.isSapReverse);
                                item.realAmount = null;
                                item.stateShow = $filter("ProgressStatus")(item.state, "inDepot");
                            });
                            value.materialList = value.detailList;
                            break;
                        case '/serviceBorrowOut/itemByPrint':
                            value.headerInfo.qrcode = value.headerInfo.borrowNo;
                            value.headerInfo.status = $filter("ProgressStatus")(value.headerInfo.status, "outDepot");
                            angular.forEach(value.detailList, function (item) {
                                item.status = $filter("ProgressStatus")(item.status, "outDepot");
                                item.outQuantityStr = '';
                            });
                            value.materialList = value.detailList;
                            break;
                        case '/borrowMaterial/getPrintList': // 借用单
                            angular.forEach(value, function (valueObj) {
                                valueObj.headerInfo.qrcode = valueObj.headerInfo.code;
                                valueObj.headerInfo.createdDateShow = $filter('YbDate')(valueObj.headerInfo.createdDate, "yyyy-MM-dd HH:mm:ss");
                                valueObj.headerInfo.expectedArrivalDateShow = $filter('YbDate')(valueObj.headerInfo.expectedArrivalDate, "yyyy-MM-dd HH:mm:ss");
                                valueObj.headerInfo.status = $filter('ProgressStatus')(valueObj.headerInfo.status, "inStore");
                                valueObj.materialList = valueObj.materialList;
                            })
                            break;
                        case '/returnMaterial/getPrintList': // 归还单
                            angular.forEach(value, function (valueObj) {
                                valueObj.headerInfo.qrcode = valueObj.headerInfo.code;
                                valueObj.headerInfo.expectedArrivalDateShow = $filter('YbDate')(valueObj.headerInfo.expectedArrivalDate, "yyyy-MM-dd HH:mm:ss");
                                valueObj.headerInfo.status = $filter('ProgressStatus')(valueObj.headerInfo.status, "outStore");
                                valueObj.materialList = valueObj.materialList;
                            })
                            break;
                        case '/salesBillOut/itemList':
                            angular.forEach(value, function (item) {
                                item.headerInfo.qrcode = item.headerInfo.salesOutBillNo;
                                item.headerInfo.billTypeStr = $filter("BillTypeStatus")(item.headerInfo.billType);
                                item.headerInfo.checkState = $filter("ProgressStatus")(item.headerInfo.checkState, "checkState");
                                item.headerInfo.outboundStatus = $filter("ProgressStatus")(item.headerInfo.outboundStatus, "outDepot");
                                item.headerInfo.outboundDate = $filter("YbDate")(item.headerInfo.outboundDate, 'yyyy-MM-dd HH:mm:ss');
                                item.headerInfo.generateDate = $filter("YbDate")(item.headerInfo.generateDate, 'yyyy-MM-dd HH:mm:ss');
                                item.headerInfo.createDate = $filter("YbDate")(item.headerInfo.createDate, 'yyyy-MM-dd HH:mm:ss');
                                angular.forEach(item.materialList, function (item, index) {
                                    item.noCus = index + 1
                                });
                            });
                            break;
                        case '/serviceBorrowIn/item':
                            value.headerInfo = value.serviceBorrowInVO;
                            value.headerInfo.statusShow = $filter("ProgressStatus")(value.serviceBorrowInVO.status, "inDepot")
                            value.headerInfo.qrcode = value.serviceBorrowInVO.borrowInNo;
                            value.headerInfo.createDate = $filter("YbDate")(value.serviceBorrowInVO.createDate, 'yyyy-MM-dd HH:mm:ss');
                            value.materialList = value.detailVOList;
                            break;
                        case '/agentReturnDetail/item':
                            angular.forEach(value, function (item) {
                                item.headerInfo = item;
                                item.headerInfo.qrcode = item.returnNo;
                                item.headerInfo.statusStr = $filter("ProgressStatus")(item.status, "returnAudit");
                                item.headerInfo.saleTypeStr = $filter("BillTypeStatus")(item.saleType);
                                item.headerInfo.checkStateStr = $filter("ProgressStatus")(item.checkState, "checkState");
                                item.headerInfo.inboundStatusStr = $filter("ProgressStatus")(item.inboundStatus, "inDepot");
                                item.headerInfo.createTimeStr = $filter("YbDate")(item.createTime, 'yyyy-MM-dd HH:mm:ss');
                                item.headerInfo.auditTimeStr = $filter("YbDate")(item.auditTime, 'yyyy-MM-dd HH:mm:ss');
                                item.materialList = item.detailVOList;
                            });
                            break;
                        case '/check/item':
                            $scope.additionalTotalPrice = value.headerInfo.totalPrice
                            value.headerInfo.paymentDate = $filter("YbDate")(value.headerInfo.paymentDate, 'yyyy-MM-dd');
                            value.headerInfo.reMoneyTypeShow = $filter("ReMoneyTypeF")(value.headerInfo.reMoneyType);
                            value.materialList = value.detailList;
                            angular.forEach(value.materialList, function (item) {
                                item.billDateShow = $filter("YbDate")(item.billDate, 'yyyy-MM-dd HH:mm:ss');
                                item.billSingleShow = $filter("orderType")(item.billSingle);
                            });
                            break;
                        case '/prepPay/item':
                            value.headerInfo = value;
                            value.headerInfo.paymentDateF = $filter("YbDate")(value.headerInfo.paymentDate, 'yyyy-MM-dd');
                            value.headerInfo.payTypeName = $filter("PayTypeF")(value.headerInfo.payType);
                            value.materialList = [{
                                dealerCode: value.dealerCode,
                                customerName: value.customerName,
                                transactionAmount: value.transactionAmount,
                                totalAmount: value.totalAmount,
                            }];
                            break;
                        case '/swyInvoice/item':
                            value.headerInfo = value;
                            value.headerInfo.createTimeF = $filter("YbDate")(value.headerInfo.createTime, 'yyyy-MM-dd HH:mm:ss');
                            value.materialList = value.invoiceDetailList;
                            $scope.previewTableData2 = [{
                                    Key: "auditUserName",
                                    Name: "审批人",
                                    colWidth: "30%",
                                    testValue: "崔雨 40057",
                                },
                                {
                                    Key: "auditUserRoleName",
                                    Name: "审批人权限",
                                    colWidth: "30%",
                                    testValue: "职务：服务维修工"
                                },
                                {
                                    Key: "auditInfo",
                                    Name: "审批节点",
                                    colWidth: "40%",
                                    testValue: "提交单据：2020-05-27 15:07:02"
                                }
                            ];
                            var resTemp = value.invoiceAuditLogs;
                            var arr = []
                            if (resTemp, length > 0) {
                                angular.forEach(resTemp, function (item) {
                                    var o = {}
                                    angular.forEach($scope.previewTableData2, function (obj) {
                                        o[obj.Key] = item[obj.Key]
                                    })
                                    arr.push(o)
                                })
                            }
                            $scope.printMyData = arr;
                            var totalNum = 0;
                            angular.forEach(value.materialList, function (item, idx) {
                                item.rowNo = idx + 1;
                                totalNum += item.amount;
                            });
                            $scope.additionalTotalPrice = totalNum;
                            break;
                        case '/logisticWayBill/printWayBillInfo':
                            value.headerInfo = value.headInfo;
                            value.headerInfo.qrcode = value.headInfo.wayBillNo;
                            value.headerInfo.deliveryTime = $filter('YbDate')(value.headInfo.deliveryTime, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.createDate = $filter('YbDate')(value.headInfo.createDate, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.status = $filter("WayBillStatus")(value.headInfo.status);

                            angular.forEach(value.linkBillDetails, function (item, index) {
                                item.noCus = index + 1;
                            });
                            value.materialList = value.linkBillDetails;
                            break;
                        case '/giftticket/exchangeOut/itemPrintInfo':
                            value.headerInfo = value.headInfo;
                            value.headerInfo.qrcode = value.headInfo.exchangeOutNo;
                            value.headerInfo.createDate = $filter('YbDate')(value.headInfo.createTime, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.createTime = $filter('YbDate')(value.headInfo.createTime, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.outboundDate = $filter('YbDate')(value.headInfo.outboundDate, "yyyy-MM-dd HH:mm:ss");
                            value.materialList = value.details;
                            break;
                        case '/logisticWaybillFee/printFeeInfo':
                            value.headerInfo = value.headInfo;
                            value.headerInfo.qrcode = value.headInfo.wayBillFeeNo;
                            value.headerInfo.status = $filter("WayBillStatus2")(value.headInfo.status);
                            value.headerInfo.auditDate = $filter('YbDate')(value.headInfo.auditDate, "yyyy-MM-dd HH:mm:ss");
                            value.headerInfo.approvalDate = $filter('YbDate')(value.headInfo.approvalDate, "yyyy-MM-dd HH:mm:ss");

                            angular.forEach(value.details, function (item,index) {
                                item.noCus = index + 1;
                                if (item.businessType == 'XGFJ') {
                                    item.businessOrderNosXGFJ = item.businessOrderNos;
                                } else if (item.businessType == 'XGSC') {
                                    item.businessOrderNosXGSC = item.businessOrderNos;
                                }
                            });
                            value.materialList = value.details;
                            break;
                        case '/socialChannelApply/item':
                            value.headerInfo = value;
                            value.headerInfo.status = $filter("ProgressStatus")(value.headerInfo.status, "socialApplyStatus");
                            value.headerInfo.applyDate = $filter("YbDate")(value.headerInfo.applyDate, 'yyyy-MM-dd HH:mm:ss');
                            value.headerInfo.dispatchDate = $filter("YbDate")(value.headerInfo.dispatchDate, 'yyyy-MM-dd HH:mm:ss');
                            value.headerInfo.auditDate = $filter("YbDate")(value.headerInfo.auditDate, 'yyyy-MM-dd HH:mm:ss');
                            angular.forEach(value.detailVOList, function (item,index) {
                                item.no = index+1;
                                item.reason = $filter("ProgressStatus")(item.reason, "socialPurchaseReason");
                            });
                            value.materialList = value.detailVOList;
                            break;
                        case '/saleIntention/item':
                            const hInfo = value.headerInfo;
                            value.headerInfo.qrcode = hInfo.saleNo;
                            value.headerInfo.deliverTypeNameShow = hInfo.sendTypeChildId ? hInfo.deliverTypeName + "-" + hInfo.sendTypeChildName : hInfo.deliverTypeName;
                            value.headerInfo.purchaseLevelNameShow = hInfo.purchaseTypeChildId ? hInfo.purchaseLevelName + "-" + hInfo.purchaseTypeChildName : hInfo.purchaseLevelName;
                            value.headerInfo.printDate = $filter('YbDate')(new Date());
                            value.headerInfo.createDateShow = $filter("YbDate")(hInfo.createDate, 'yyyy-MM-dd HH:mm:ss');
                            break;
                        case '/deliveryReceipt/item4PrintDetail':
                            angular.forEach(value, function (item) {
                                item.headerInfo = item || {};
                                item.headerInfo.boxNo = `${item.boxNo}`;
                                item.headerInfo.qrcode = item.boxupNo;
                                item.headerInfo.mjweight = `${item.roughWeight || ''}/${item.weight || ''}KG`;
                                item.headerInfo.lwh = `${item.lenghtNum || ''}*${item.withNum || ''}*${item.hightNum || ''}MM`;
                                item.headerInfo.createTimeShow = $filter('YbDate')(item.createTime, "yyyy-MM-dd HH:mm:ss");
                                angular.forEach(item.materialsList, function (item, index) {
                                    item.noCus = index + 1
                                });
                                item.materialList = item.materialsList;
                            });
                            break;
                        case '/contract/item':
                            value.headerInfo = value;
                            value.headerInfo.qrcode = value.billNo;
                            value.headerInfo.createDateShow = $filter("YbDate")(value.headerInfo.createDate, 'yyyy-MM-dd HH:mm:ss');
                            value.materialList = value.materialsList;
                            break;
                        case '/distributormargin/item':
                            value.headerInfo = value;
                            value.headerInfo.qrcode = value.billNo;
                            value.headerInfo.createDateShow = $filter("YbDate")(value.headerInfo.createDate, 'yyyy-MM-dd HH:mm:ss');
                            value.materialList = value.detailVOS;
                            value.materialList.forEach(item => {
                                item.billSingleF = $filter("orderType")(item.billSingle); // 单据名称
                                item.billDateF = $filter("YbDate")(item.billDate, 'yyyy-MM-dd HH:mm:ss'); // 单据创建时间
                                item.saleBillTypeStr = $filter("BillTypeStatus")(item.saleBillType); // 单据类型
                                item.remainPrice = item.receivePrice; // 应收金额
                                item.receivePrice = ybWidget.Minus(item.totalPrice, item.remainPrice); // 已收金额
                            })
                            break;
                        case '/laborses/item':
                            value.headerInfo = value;
                            value.headerInfo.qrcode = value.billNo;
                            value.headerInfo.createDateShow = $filter("YbDate")(value.headerInfo.createDate, 'yyyy-MM-dd HH:mm:ss');
                            value.materialList = value.detailVOS;
                            value.materialList.forEach(item => {
                                item.billSingleF = $filter("orderType")(item.billSingle); // 单据名称
                                item.billDateF = $filter("YbDate")(item.billDate, 'yyyy-MM-dd HH:mm:ss'); // 单据创建时间
                                item.saleBillTypeStr = $filter("BillTypeStatus")(item.saleBillType); // 单据类型
                                item.remainPrice = item.receivePrice; // 应收金额
                                item.receivePrice = ybWidget.Minus(item.totalPrice, item.remainPrice); // 已收金额
                            })
                            break;          
                        default:
                            break;
                    }
                }

                $scope.printMyData = [];

                /*获取打印数据*/
                function getPrintTableData() {
                    if ($scope.OrderInfo.length > 0) {
                        return $q.when(true);
                    }

                    const {
                        printDataInfo,
                        cusInterface: url = window.PrintData[$scope.printType].Interface,
                        isBatchPrint: isSpecialBatchPrint // 为true时，是循环复用单行打印的逻辑。(接口返回的数据结构：需要用数组包装)
                    } = $scope.parentScopeParam;

                    if (printDataInfo) {
                        handleOrderInfo(url, printDataInfo);
                        return $q.when(true);
                    }

                    var httpGet = adaptController.GetHttpGetMethod();
                    var service = "device";
                    var param = formatPrintData($scope.parentScopeParam);
                    return httpGet(service, url, param).then(function (data) {
                        if (data.code !== 0) {
                            adaptController.ShowMessage(data);
                            return false;
                        }

                        if (isSpecialBatchPrint) {
                            var orderListT = [];
                            angular.forEach(data.value, function (item) {
                                // 循环调用原来接口(单行打印)的前端数据处理逻辑
                                dealField(window.PrintData[$scope.printType].Interface, item);
                                orderListT.push(item);
                            })
                            $scope.OrderInfo = orderListT;
                        } else {
                            handleOrderInfo(url, data.value);
                        }
                        if (!$scope.OrderInfo || $scope.OrderInfo.length == 0) {
                            adaptController.ShowMessage("打印数据为空，请确认!");
                            return false;
                        }
                        return true;
                    });
                }

                function handleOrderInfo(url, data) {
                    dealField(url, data);
                    $scope.OrderInfo = Array.isArray(data) ? data : [data];
                }

                function formatPrintData(printObj) {
                    const { billId: billIds, cusParam: cusParamObj } = printObj
                    var param = {};
                    if (cusParamObj) {
                        param = cusParamObj;
                    } else {
                        param.id = billIds[0];
                        param.billId = billIds[0];
                    }
                    return param;
                }

                $scope.isWorldBreak = function () {
                    if (!$scope.printTempStyle.WordWrap) {
                        return {
                            'word-break': 'keep-all',
                            'overflow': 'hidden',
                            'white-space': 'nowrap',
                            'line-height': 'inherit'
                        }
                    }
                };
                $scope.setWidth = function (item, type) {
                    var str = '';
                    switch (type) {
                        case 'SetHeaderColumn':
                            str = $scope.printTempStyle.SetHeaderColumn;
                            break;
                        case 'SetFootColumn':
                            str = $scope.printTempStyle.SetFootColumn;
                            break;
                        default:
                            break;
                    }
                    if (item.IsAloneRow) {
                        return {
                            'width': '99%'
                        }
                    } else {
                        if (item.Name == '二维码') {
                            return {
                                'width': 'auto',
                                'float': 'left',
                                'position': 'absolute',
                                'right': '3px',
                                'top': 0
                            }
                        } else {
                            return {
                                'width': 99 / parseInt(str) + "%",
                                'float': 'left'
                            }
                        }
                    }
                };

                (function () {
                    $scope.printType = $scope.parentScopeParam?.printType || '';
                    currentTemplate = DEFAULT_TEMPLATE_FUN($scope.printType);
                    if (!currentTemplate) {
                        adaptController.ShowMessage("打印类型不存在，请确认!");
                        return;
                    }
                    receiveMessageToPrint();
                })();
            }
        ]);

})(window, window.angular);
